From: notaz Date: Tue, 9 Nov 2010 21:28:33 +0000 (+0200) Subject: SDL-1.2.14 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e14743d15a38081776e29fcc16d2de7e61e3d2b6;p=sdl_omap.git SDL-1.2.14 --- e14743d15a38081776e29fcc16d2de7e61e3d2b6 diff --git a/BUGS b/BUGS new file mode 100644 index 0000000..218bf3d --- /dev/null +++ b/BUGS @@ -0,0 +1,18 @@ + +Bugs are now managed in the SDL bug tracker, here: + + http://bugzilla.libsdl.org/ + +You may report bugs there, and search to see if a given issue has already + been reported, discussed, and maybe even fixed. + + + +You may also find help at the SDL mailing list. Subscription information: + + http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org + +Bug reports are welcome here, but we really appreciate if you use Bugzilla, as + bugs discussed on the mailing list may be forgotten or missed. + + diff --git a/Borland.html b/Borland.html new file mode 100644 index 0000000..eaf8209 --- /dev/null +++ b/Borland.html @@ -0,0 +1,139 @@ + + + + Building SDL with Borland's C++ compilers + + + + + +

Building SDL with Borland's C++ compilers.

+ by David Snopek + and updated by Dominique + Louis ( Last updated : 30th June 2003 ).
+
+ These instructions cover how to compile SDL and its included test +programs using either Borland C++ Builder 5, 6 for Windows, + C++ Builder for Linux ( AKA Kylix 3 ) or the free Borland C++ command-line compiler.
+ +

Extract the files

+ +

Unzip the Borland.zip archive into this directory. Do not unzip + it into any other directory because the makefiles ( *.mak ) and project + files ( *.bpr ) use relative paths to refer to the SDL sources. This should + create a directory named "Borland" inside of the top level SDL source directory. +

+ +

Using Borland C++ Builder 5, 6 for Windows +

+ +

Inside of the "Borland" directory there is a "bcb6" directory that contains + a number of Builder project files. Double-click on the "libSDL.bpg" file + icon. Once Builder has started click on the "Projects" menu on +the menu-bar and go down to "Build All Projects" option.
+ This will proceed to build SDL ( with Borland's calling convention ), +SDLmain, and all the test programs. Currently, all +the test programs are dynamically linked to Sam Lantinga's +SDL.dll.

+ +

NOTE : Borland's "lib" format and Microsoft's "lib" format are incompatible. + 
+ If you wish to dynamically link to the SDL library supplied by Sam Lantinga + in each release, I have created the correct *.libs for SDL 1.2.4 and they + exist in the "/lib" directory.
+ If you would like to create the *.lib files yourself, you will need to +make use of Borland's "implib.exe" utility.
+

+ +

IMPLIB works like this:

+ +
    IMPLIB (destination lib name) (source dll)
+ +

For example,

+ +
    IMPLIB SDL.lib SDL.dll
+ +

This assumes that SDL.dll was compiled with Visual C++ or similar.
+

+ +

To learn more about the difference between Borland's and Microsoft's *.lib + format please read the article here.
+

+ +


+ NOTE :
The C++ Builder for Windows project format, is not compatible + with the Kylix 3 project format, hence the reason why they are in separate + directories.

+ +

Using the free Borland C++ command-line compiler +

+ +

The free Borland compiler can be downloaded at no charge from the Borland website + . Make sure that it is installed and properly configured.

+ +

Open an MS-DOS Prompt. Change to the "Borland\freebcc" directory under + the SDL source directory. Type "make -f SDL.mak" to build SDL and "make + -f SDLmain.mak". There are also makefiles for all of the test programs, if you wish to build them. All .exes and +DLLs are created in the "test" SDL directory. Ify ou would like to create +the DLL and all the test applications, I have thrown together a basic batchfile +called "makeall.bat" which should create everything in the right order.

+ +

Output files

+ No matter which compiler you used, three important files should have + been produced: + + Both of the *.lib files will need to be added to all the projects +that use SDL and SDL.dll must be placed some where the Windows dynamic +linker can find it (either in your project directory or on the system +path, C:\WINDOWS\SYSTEM). +

Using Borland C++ Builder for Linux ( AKA Kylix + 3 )

+ +

Inside of the "Borland" directory there is a "k3" directory that contains + a number of Builder project files. Double-click on the "libSDL.bpg" file + icon. Once Builder has started click on the "Projects" menu on +the menu-bar and go down to "Build All Projects" option. This will +proceed to build all the test programs
+ Linux users do not need *.lib files as the Shared Object is linked right + into the project ( very neat actually, Windows should do this sort of thing + as it is a lot easier for the developer ).
+ NOTE : The C++ Builder for Windows project format, is not + compatible with the Kylix 3 project format, hence the reason why they are + in separate directories.

+ +

On Mandrake 8.1 the shared objects for SDL are located in the /usr/lib + directory as libSDL_*.so and the Mesa OpenGL shared objects are located +in /usr/X11R6/lib as libGL*.so
+
+ So if your setup is different you may need to change the project file + so that they re-link to the ones on your system.
+
+ On Mandrake 8.1 the headers files are located at /usr/include/SDL/. + So if you you have not installed the development RPMs ( usually named libSDL-devel* + ) for SDL ( not included ) you may have to change the include directory + within some of the projects.
+

+ +

Known Problems

+ The only known problem is that I ( Dominique Louis ), was unable to +create the projects that rebuilt the SDL shared objects under Linux, due +to time constraints and my lack of intimate knowledge of Linux. +

Test programs

+ Some of the test programs require included media files ( *.wav; *.bmp +etc ). All the test programs are now created in the "test" directory, where +the media files are ( usually ) so they should be ready to go.
+
+
+
+ + diff --git a/Borland.zip b/Borland.zip new file mode 100644 index 0000000..ed8f45d Binary files /dev/null and b/Borland.zip differ diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..2cba2ac --- /dev/null +++ b/COPYING @@ -0,0 +1,458 @@ + 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 diff --git a/CREDITS b/CREDITS new file mode 100644 index 0000000..efdcfa4 --- /dev/null +++ b/CREDITS @@ -0,0 +1,94 @@ + +Simple DirectMedia Layer CREDITS +Thanks to everyone who made this possible, including: + +* Cliff Matthews, for giving me a reason to start this project. :) + -- Executor rocks! *grin* + +* Scott Call, for making a home for SDL on the 'Net... Thanks! :) + +* The Linux Fund, C Magazine, Educational Technology Resources Inc., + Gareth Noyce, Jesse Pavel, Keith Kitchin, Jeremy Horvath, Thomas Nicholson, + Hans-Peter Gygax, the Eternal Lands Development Team, Lars Brubaker, + and Phoenix Kokido for financial contributions + +* Gaëtan de Menten for writing the PHP and SQL behind the SDL website + +* Tim Jones for the new look of the SDL website + +* Marco Kraus for setting up SDL merchandise + +* Martin Donlon for his work on the SDL Documentation Project + +* Ryan Gordon for helping everybody out and keeping the dream alive. :) + +* IBM R&D Lab for their PS3 SPE video acceleration code + +* Mattias Engdegård, for help with the Solaris port and lots of other help + +* Max Watson, Matt Slot, and Kyle for help with the MacOS Classic port + +* Stan Shebs, for the initial Mac OS X port + +* Eric Wing, Max Horn, and Darrell Walisser for unflagging work on the Mac OS X port + +* Patrick Trainor, Jim Boucher, and Mike Gorchak for the QNX Neutrino port + +* Carsten Griwodz for the AIX port + +* Gabriele Greco, for the Amiga port + +* Patrice Mandin, for the Atari port + +* Hannu Viitala for the EPOC port + +* Marcus Mertama for the S60 port. + +* Peter Valchev for nagging me about the OpenBSD port until I got it right. :) + +* Kent B Mein, for a place to do the IRIX port + +* Ash, for a place to do the OSF/1 Alpha port + +* David Sowsy, for help with the BeOS port + +* Eugenia Loli, for endless work on porting SDL games to BeOS + +* Jon Taylor for the GGI front-end + +* Paulus Esterhazy, for the Visual C++ testing and libraries + +* Brenda Tantzen, for Metrowerks CodeWarrior on MacOS + +* Chris Nentwich, for the Hermes assembly blitters + +* Michael Vance and Jim Kutter for the X11 OpenGL support + +* Stephane Peter, for the AAlib front-end and multi-threaded timer idea. + +* Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation + +* Peter Wiklund, for the 1998 winning SDL logo, + and Arto Hamara, Steven Wong, and Kent Mein for other logo entries. + +* Arne Claus, for the 2004 winning SDL logo, + and Shandy Brown, Jac, Alex Lyman, Mikkel Gjoel, #Guy, Jonas Hartmann, + Daniel Liljeberg, Ronald Sowa, DocD, Pekka Jaervinen, Patrick Avella, + Erkki Kontilla, Levon Gavalian, Hal Emerich, David Wiktorsson, + S. Schury and F. Hufsky, Ciska de Ruyver, Shredweat, Tyler Montbriand, + Martin Andersson, Merlyn Wysard, Fernando Ibanez, David Miller, + Andre Bommele, lovesby.com, Francisco Camenforte Torres, and David Igreja + for other logo entries. + +* Bob Pendleton and David Olofson for being long time contributors to + the SDL mailing list. + +* Everybody at Loki Software, Inc. for their great contributions! + + And a big hand to everyone else who gave me appreciation, advice, + and suggestions, especially the good folks on the SDL mailing list. + +THANKS! :) + + -- Sam Lantinga + diff --git a/CWprojects.sea.bin b/CWprojects.sea.bin new file mode 100644 index 0000000..e8a6fdc Binary files /dev/null and b/CWprojects.sea.bin differ diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..1a30fba --- /dev/null +++ b/INSTALL @@ -0,0 +1,23 @@ + +To compile and install SDL: + + 1. Run './configure; make; make install' + + If you are compiling for Windows using gcc, read the FAQ at: + http://www.libsdl.org/faq.php?action=listentries&category=4#42 + + If you are compiling using Visual C++ on Win32, you should read + the file VisualC.html + + 2. Look at the example programs in ./test, and check out the HTML + documentation in ./docs to see how to use the SDL library. + + 3. Join the SDL developer mailing list by sending E-mail to + sdl-request@libsdl.org + and put "subscribe" in the subject of the message. + + Or alternatively you can use the web interface: + http://www.libsdl.org/mailing-list.php + +That's it! +Sam Lantinga diff --git a/MPWmake.sea.bin b/MPWmake.sea.bin new file mode 100644 index 0000000..b345e08 Binary files /dev/null and b/MPWmake.sea.bin differ diff --git a/Makefile.dc b/Makefile.dc new file mode 100644 index 0000000..58d6e71 --- /dev/null +++ b/Makefile.dc @@ -0,0 +1,111 @@ +#GL=1 + +CC = sh-elf-gcc +AR = sh-elf-ar + +ifdef GL +DEFS += -DSDL_VIDEO_OPENGL=1 +TARGET = libSDL_gl.a +else +TARGET = libSDL.a +endif + +CFLAGS=$(KOS_CFLAGS) $(DEFS) -Iinclude + +SRCS = \ + src/audio/dc/SDL_dcaudio.c \ + src/audio/dc/aica.c \ + src/audio/dummy/SDL_dummyaudio.c \ + src/audio/SDL_audio.c \ + src/audio/SDL_audiocvt.c \ + src/audio/SDL_audiodev.c \ + src/audio/SDL_mixer.c \ + src/audio/SDL_wave.c \ + src/cdrom/dc/SDL_syscdrom.c \ + src/cdrom/SDL_cdrom.c \ + src/events/SDL_active.c \ + src/events/SDL_events.c \ + src/events/SDL_expose.c \ + src/events/SDL_keyboard.c \ + src/events/SDL_mouse.c \ + src/events/SDL_quit.c \ + src/events/SDL_resize.c \ + src/file/SDL_rwops.c \ + src/joystick/dc/SDL_sysjoystick.c \ + src/joystick/SDL_joystick.c \ + src/loadso/dummy/SDL_sysloadso.c \ + src/SDL.c \ + src/SDL_error.c \ + src/SDL_fatal.c \ + src/stdlib/SDL_getenv.c \ + src/stdlib/SDL_iconv.c \ + src/stdlib/SDL_malloc.c \ + src/stdlib/SDL_qsort.c \ + src/stdlib/SDL_stdlib.c \ + src/stdlib/SDL_string.c \ + src/thread/dc/SDL_syscond.c \ + src/thread/dc/SDL_sysmutex.c \ + src/thread/dc/SDL_syssem.c \ + src/thread/dc/SDL_systhread.c \ + src/thread/SDL_thread.c \ + src/timer/dc/SDL_systimer.c \ + src/timer/SDL_timer.c \ + src/video/dc/SDL_dcevents.c \ + src/video/dc/SDL_dcvideo.c \ + src/video/dummy/SDL_nullevents.c \ + src/video/dummy/SDL_nullmouse.c \ + src/video/dummy/SDL_nullvideo.c \ + src/video/SDL_blit.c \ + src/video/SDL_blit_0.c \ + src/video/SDL_blit_1.c \ + src/video/SDL_blit_A.c \ + src/video/SDL_blit_N.c \ + src/video/SDL_bmp.c \ + src/video/SDL_cursor.c \ + src/video/SDL_gamma.c \ + src/video/SDL_pixels.c \ + src/video/SDL_RLEaccel.c \ + src/video/SDL_stretch.c \ + src/video/SDL_surface.c \ + src/video/SDL_video.c \ + src/video/SDL_yuv.c \ + src/video/SDL_yuv_sw.c \ + +OBJS = $(SRCS:.c=.o) + +TEST = \ + test/checkkeys.c \ + test/graywin.c \ + test/loopwave.c \ + test/testalpha.c \ + test/testbitmap.c \ + test/testcdrom.c \ + test/testerror.c \ + test/testgamma.c \ + test/testgl.c \ + test/testhread.c \ + test/testjoystick.c \ + test/testkeys.c \ + test/testlock.c \ + test/testoverlay.c \ + test/testpalette.c \ + test/testsem.c \ + test/testsprite.c \ + test/testtimer.c \ + test/testtypes.c \ + test/testver.c \ + test/testvidinfo.c \ + test/testwin.c \ + test/testwm.c \ + test/threadwin.c \ + test/torturethread.c \ + +$(TARGET): copy_config \ + $(OBJS) + $(AR) rcs $(TARGET) $(OBJS) + +copy_config: + @cp include/SDL_config.h.default include/SDL_config.h + +clean: + rm -f include/SDL_config.h $(OBJS) diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..e29dc6d --- /dev/null +++ b/Makefile.in @@ -0,0 +1,183 @@ +# Makefile to build and install the SDL library + +top_builddir = . +srcdir = @srcdir@ +objects = build +depend = build-deps +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +libdir = @libdir@ +includedir = @includedir@ +datarootdir = @datarootdir@ +datadir = @datadir@ +mandir = @mandir@ +auxdir = @ac_aux_dir@ +distpath = $(srcdir)/.. +distdir = SDL-@SDL_VERSION@ +distfile = $(distdir).tar.gz + +@SET_MAKE@ +SHELL = @SHELL@ +CC = @CC@ +INCLUDE = @INCLUDE@ +CFLAGS = @BUILD_CFLAGS@ +EXTRA_CFLAGS = @EXTRA_CFLAGS@ +LDFLAGS = @BUILD_LDFLAGS@ +EXTRA_LDFLAGS = @EXTRA_LDFLAGS@ +LIBTOOL = @LIBTOOL@ +INSTALL = @INSTALL@ +NASM = @NASM@ @NASMFLAGS@ +AR = @AR@ +RANLIB = @RANLIB@ +WINDRES = @WINDRES@ + +TARGET = libSDL.la +SOURCES = @SOURCES@ +OBJECTS = @OBJECTS@ + +SDLMAIN_TARGET = libSDLmain.a +SDLMAIN_SOURCES = @SDLMAIN_SOURCES@ +SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@ + +DIST = acinclude autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS CWprojects.sea.bin docs docs.html include INSTALL Makefile.dc Makefile.minimal Makefile.in MPWmake.sea.bin README* sdl-config.in sdl.m4 sdl.pc.in SDL.qpg.in SDL.spec SDL.spec.in src test TODO VisualCE.zip VisualC.html VisualC.zip Watcom-OS2.zip Watcom-Win32.zip symbian.zip WhatsNew Xcode.tar.gz + +HDRS = SDL.h SDL_active.h SDL_audio.h SDL_byteorder.h SDL_cdrom.h SDL_cpuinfo.h SDL_endian.h SDL_error.h SDL_events.h SDL_getenv.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_platform.h SDL_quit.h SDL_rwops.h SDL_stdinc.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_types.h SDL_version.h SDL_video.h begin_code.h close_code.h + +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_RELEASE = @LT_RELEASE@ +LT_REVISION = @LT_REVISION@ +LT_LDFLAGS = -no-undefined -rpath $(DESTDIR)$(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) + +all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) + +$(srcdir)/configure: $(srcdir)/configure.in + @echo "Warning, configure.in is out of date" + #(cd $(srcdir) && sh autogen.sh && sh configure) + @sleep 3 + +Makefile: $(srcdir)/Makefile.in + $(SHELL) config.status $@ + +$(objects): + $(SHELL) $(auxdir)/mkinstalldirs $@ + +.PHONY: all depend install install-bin install-hdrs install-lib install-data install-man uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data uninstall-man clean distclean dist +depend: + @SOURCES="$(SOURCES)" INCLUDE="$(INCLUDE)" output="$(depend)" \ + $(SHELL) $(auxdir)/makedep.sh + @for src in $(SDLMAIN_SOURCES); do \ + obj=`echo $$src | sed -e 's|.*/||' -e 's|\.[^\.]*$$|.o|'`; \ + echo "\$$(objects)/$$obj: $$src" >>$(depend); \ + echo " \$$(CC) \$$(CFLAGS) \$$(EXTRA_CFLAGS) -c $$src -o \$$@" >>$(depend); \ + done + +include $(depend) + +$(objects)/$(TARGET): $(OBJECTS) + $(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) + +$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS) + $(AR) cru $@ $(SDLMAIN_OBJECTS) + $(RANLIB) $@ + +install: all install-bin install-hdrs install-lib install-data install-man +install-bin: + $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir) + $(INSTALL) -m 755 sdl-config $(DESTDIR)$(bindir)/sdl-config +install-hdrs: + $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL + for file in $(HDRS); do \ + $(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL/$$file; \ + done + $(INSTALL) -m 644 include/SDL_config.h $(DESTDIR)$(includedir)/SDL/SDL_config.h +install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) + $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET) + $(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET) + $(RANLIB) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET) +install-data: + $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal + $(INSTALL) -m 644 $(srcdir)/sdl.m4 $(DESTDIR)$(datadir)/aclocal/sdl.m4 + $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig + $(INSTALL) -m 644 sdl.pc $(DESTDIR)$(libdir)/pkgconfig +install-man: + $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(mandir)/man3 + for src in $(srcdir)/docs/man3/*.3; do \ + file=`echo $$src | sed -e 's|^.*/||'`; \ + $(INSTALL) -m 644 $$src $(DESTDIR)$(mandir)/man3/$$file; \ + done + +uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data uninstall-man +uninstall-bin: + rm -f $(DESTDIR)$(bindir)/sdl-config +uninstall-hdrs: + for file in $(HDRS); do \ + rm -f $(DESTDIR)$(includedir)/SDL/$$file; \ + done + rm -f $(DESTDIR)$(includedir)/SDL/SDL_config.h + -rmdir $(DESTDIR)$(includedir)/SDL +uninstall-lib: + $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(TARGET) + rm -f $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET) +uninstall-data: + rm -f $(DESTDIR)$(datadir)/aclocal/sdl.m4 + rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl.pc +uninstall-man: + for src in $(srcdir)/docs/man3/*.3; do \ + file=`echo $$src | sed -e 's|^.*/||'`; \ + rm -f $(DESTDIR)$(mandir)/man3/$$file; \ + done + +clean: + rm -rf $(objects) + if test -f test/Makefile; then (cd test; $(MAKE) $@); fi + +distclean: clean + rm -f Makefile include/SDL_config.h sdl-config + rm -f SDL.qpg + rm -f config.status config.cache config.log libtool $(depend) + rm -rf $(srcdir)/autom4te* + rm -rf $(srcdir)/test/autom4te* + find $(srcdir) \( \ + -name '*~' -o \ + -name '*.bak' -o \ + -name '*.old' -o \ + -name '*.rej' -o \ + -name '*.orig' -o \ + -name '.#*' \) \ + -exec rm -f {} \; + cp $(srcdir)/include/SDL_config.h.default $(srcdir)/include/SDL_config.h + if test -f test/Makefile; then (cd test; $(MAKE) $@); fi + +dist $(distfile): + $(SHELL) $(auxdir)/mkinstalldirs $(distdir) + tar cf - $(DIST) | (cd $(distdir); tar xf -) + cp $(distdir)/include/SDL_config.h.default $(distdir)/include/SDL_config.h + rm -rf `find $(distdir) -name .svn` + rm -rf $(distdir)/test/autom4te* + find $(distdir) \( \ + -name '*~' -o \ + -name '*.bak' -o \ + -name '*.old' -o \ + -name '*.rej' -o \ + -name '*.orig' -o \ + -name '.#*' \) \ + -exec rm -f {} \; + if test -f $(distdir)/test/Makefile; then (cd $(distdir)/test && make distclean); fi + tar cvf - $(distdir) | gzip --best >$(distfile) + rm -rf $(distdir) + +rpm: $(distfile) + rpmbuild -ta $? + +# Create a SVN snapshot that people can run update on +snapshot: + svn co http://svn.libsdl.org/branches/SDL-1.2 + (cd SDL-1.2 && ./autogen.sh && rm -rf autom4te.cache) + cp SDL-1.2/include/SDL_config.h.default SDL-1.2/include/SDL_config.h + tar zcf $(HOME)/SDL-1.2.tar.gz SDL-1.2 + rm -f $(HOME)/SDL-1.2.zip + zip -r $(HOME)/SDL-1.2.zip SDL-1.2 + rm -rf SDL-1.2 diff --git a/Makefile.minimal b/Makefile.minimal new file mode 100644 index 0000000..827621c --- /dev/null +++ b/Makefile.minimal @@ -0,0 +1,42 @@ +# Makefile to build the SDL library + +INCLUDE = -I./include +CFLAGS = -g -O2 $(INCLUDE) +AR = ar +RANLIB = ranlib + +CONFIG_H = include/SDL_config.h +TARGET = libSDL.a +SOURCES = \ + src/*.c \ + src/audio/*.c \ + src/cdrom/*.c \ + src/cpuinfo/*.c \ + src/events/*.c \ + src/file/*.c \ + src/joystick/*.c \ + src/stdlib/*.c \ + src/thread/*.c \ + src/timer/*.c \ + src/video/*.c \ + src/audio/dummy/*.c \ + src/video/dummy/*.c \ + src/joystick/dummy/*.c \ + src/cdrom/dummy/*.c \ + src/thread/generic/*.c \ + src/timer/dummy/*.c \ + src/loadso/dummy/*.c \ + +OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g') + +all: $(TARGET) + +$(TARGET): $(CONFIG_H) $(OBJECTS) + $(AR) crv $@ $^ + $(RANLIB) $@ + +$(CONFIG_H): + cp $(CONFIG_H).default $(CONFIG_H) + +clean: + rm -f $(TARGET) $(OBJECTS) diff --git a/README b/README new file mode 100644 index 0000000..7c0dd58 --- /dev/null +++ b/README @@ -0,0 +1,49 @@ + + Simple DirectMedia Layer + + (SDL) + + Version 1.2 + +--- +http://www.libsdl.org/ + +This is the Simple DirectMedia Layer, a general API that provides low +level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, +and 2D framebuffer across multiple platforms. + +The current version supports Linux, Windows CE/95/98/ME/XP/Vista, BeOS, +MacOS Classic, Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, +and QNX. The code contains support for Dreamcast, Atari, AIX, OSF/Tru64, +RISC OS, SymbianOS, Nintendo DS, and OS/2, but these are not officially +supported. + +SDL is written in C, but works with C++ natively, and has bindings to +several other languages, including Ada, C#, Eiffel, Erlang, Euphoria, +Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP, +Pike, Pliant, Python, Ruby, and Smalltalk. + +This library is distributed under GNU LGPL version 2, which can be +found in the file "COPYING". This license allows you to use SDL +freely in commercial programs as long as you link with the dynamic +library. + +The best way to learn how to use SDL is to check out the header files in +the "include" subdirectory and the programs in the "test" subdirectory. +The header files and test programs are well commented and always up to date. +More documentation is available in HTML format in "docs/index.html", and +a documentation wiki is available online at: + http://www.libsdl.org/cgi/docwiki.cgi + +The test programs in the "test" subdirectory are in the public domain. + +Frequently asked questions are answered online: + http://www.libsdl.org/faq.php + +If you need help with the library, or just want to discuss SDL related +issues, you can join the developers mailing list: + http://www.libsdl.org/mailing-list.php + +Enjoy! + Sam Lantinga (slouken@libsdl.org) + diff --git a/README-SDL.txt b/README-SDL.txt new file mode 100644 index 0000000..4d36ca9 --- /dev/null +++ b/README-SDL.txt @@ -0,0 +1,13 @@ + +Please distribute this file with the SDL runtime environment: + +The Simple DirectMedia Layer (SDL for short) is a cross-platfrom library +designed to make it easy to write multi-media software, such as games and +emulators. + +The Simple DirectMedia Layer library source code is available from: +http://www.libsdl.org/ + +This library is distributed under the terms of the GNU LGPL license: +http://www.gnu.org/copyleft/lesser.html + diff --git a/README.AmigaOS b/README.AmigaOS new file mode 100644 index 0000000..e0d8906 --- /dev/null +++ b/README.AmigaOS @@ -0,0 +1,12 @@ +The AmigaOS code has been removed from SDL, since it had been broken for a + long time and had a few bits of fairly invasive code #ifdef'd into the + SDL core. + +However, there is an OS4 version of SDL here: + http://www.rcdrummond.net/amiga/index.html + +And a MorphOS version here: + http://www.lehtoranta.net/powersdl/ + +--ryan. + diff --git a/README.BeOS b/README.BeOS new file mode 100644 index 0000000..ccdccf5 --- /dev/null +++ b/README.BeOS @@ -0,0 +1,13 @@ + +SDL on BeOS R5 +============== + +You can build SDL on BeOS like any other GNU style package. +e.g. ./configure && make && make install +By default it is installed in /boot/develop/tools/gnupro/{bin,lib,etc.} + +Once you install SDL, you need to copy libSDL.so to /boot/home/config/lib, +so it can be found by the dynamic linker. + +Enjoy! + Sam Lantinga (slouken@libsdl.org) diff --git a/README.CVS b/README.CVS new file mode 100644 index 0000000..7664e91 --- /dev/null +++ b/README.CVS @@ -0,0 +1,4 @@ + +SDL is no longer hosted in a CVS repository. Please see README.SVN for +information on accessing our Subversion repository. + diff --git a/README.DC b/README.DC new file mode 100644 index 0000000..e2fb1d6 --- /dev/null +++ b/README.DC @@ -0,0 +1,32 @@ +SDL for Dreamcast (beta2) + + BERO + berobero@users.sourceforge.net + + http://www.geocities.co.jp/Playtown/2004/ + +this work with kos-newlib +http://sourceforge.net/projects/dcquake/ + +compile +- source environ.sh (from the KOS distribution) +- make -f Makefile.dc + +compile with gl support +- install latest libgl from http://sourceforge.net/projects/dcquake/ +- uncomment GL=1 in Makefile.dc +- make -f Makefile.dc clean +- make -f Makefile.dc + +install +- copy include/*.h and libSDL.a or libSDL_gl.a for your enviroment + +changelog: + +beta2 +- OpenGL support +- Hardware page flip support + +beta +- thread, timer don't tested so much. +- not support OpenGL diff --git a/README.MacOS b/README.MacOS new file mode 100644 index 0000000..acfd935 --- /dev/null +++ b/README.MacOS @@ -0,0 +1,63 @@ + +============================================================================== +Using the Simple DirectMedia Layer with MacOS 7,8,9 on PPC +============================================================================== + +These instructions are for people using the Apple MPW environment: +http://developer.apple.com/tools/mpw-tools/ + +CodeWarrior projects are available in the CWprojects directory. + +============================================================================== +I. Building the Simple DirectMedia Layer libraries: + (This step isn't necessary if you have the SDL binary distribution) + + First, unpack the MPWmake.sea.hqx archive and move SDL.make into the + SDL directory. + + Start MPW + + Set the current directory within MPW to the SDL toplevel directory. + + Build "SDL" (Type Command-B and enter "SDL" in the dialog) + + If everything compiles successfully, you now have the PPC libraries + "SDL" and "SDLmain.o" in the 'lib' subdirectory. + +============================================================================== +II. Building the Simple DirectMedia Layer test programs: + + First, unpack the MPWmake.sea.hqx archive, move the new rsrc directory to + the main SDL directory, and move the makefiles in the new test subdirectory + to the SDL 'test' subdirectory. + + Start MPW + + Set the current directory within MPW to the SDL 'test' subdirectory. + + Build the programs that have an associated MPW makefile (file ending + with .make), including "testwin", "testalpha", and "graywin". + + Copy the SDL library file into the test directory, and run! + +============================================================================== +III. Building the Simple DirectMedia Layer demo programs: + + Copy one of the test program Makefiles to the demo directory + and modify it to match the sources in the demo. + +============================================================================== +IV. Enjoy! :) + + If you have a project you'd like me to know about, or want to ask questions, + go ahead and join the SDL developer's mailing list by sending e-mail to: + + sdl-request@libsdl.org + + and put "subscribe" into the subject of the message. Or alternatively you + can use the web interface: + + http://www.libsdl.org/mailman/listinfo/sdl + +============================================================================== + diff --git a/README.MacOSX b/README.MacOSX new file mode 100644 index 0000000..3bc4213 --- /dev/null +++ b/README.MacOSX @@ -0,0 +1,186 @@ +============================================================================== +Using the Simple DirectMedia Layer with Mac OS X +============================================================================== + +These instructions are for people using Apple's Mac OS X (pronounced +"ten"). + +From the developer's point of view, OS X is a sort of hybrid Mac and +Unix system, and you have the option of using either traditional +command line tools or Apple's IDE Xcode. + +To build SDL using the command line, use the standard configure and make +process: + + ./configure + make + sudo make install + +You can also build SDL as a Universal library (a single binary for both +PowerPC and Intel architectures), on Mac OS X 10.4 and newer, by using +the fatbuild.sh script in build-scripts: + sh build-scripts/fatbuild.sh + sudo build-scripts/fatbuild.sh install +This script builds SDL with 10.2 ABI compatibility on PowerPC and 10.4 +ABI compatibility on Intel architectures. For best compatibility you +should compile your application the same way. A script which wraps +gcc to make this easy is provided in test/gcc-fat.sh + +To use the library once it's built, you essential have two possibilities: +use the traditional autoconf/automake/make method, or use Xcode. + +============================================================================== +Using the Simple DirectMedia Layer with a traditional Makefile +============================================================================== + +An existing autoconf/automake build system for your SDL app has good chances +to work almost unchanged on OS X. However, to produce a "real" Mac OS X binary +that you can distribute to users, you need to put the generated binary into a +so called "bundle", which basically is a fancy folder with a name like +"MyCoolGame.app". + +To get this build automatically, add something like the following rule to +your Makefile.am: + +bundle_contents = APP_NAME.app/Contents +APP_NAME_bundle: EXE_NAME + mkdir -p $(bundle_contents)/MacOS + mkdir -p $(bundle_contents)/Resources + echo "APPL????" > $(bundle_contents)/PkgInfo + $(INSTALL_PROGRAM) $< $(bundle_contents)/MacOS/ + +You should replace EXE_NAME with the name of the executable. APP_NAME is what +will be visible to the user in the Finder. Usually it will be the same +as EXE_NAME but capitalized. E.g. if EXE_NAME is "testgame" then APP_NAME +usually is "TestGame". You might also want to use @PACKAGE@ to use the package +name as specified in your configure.in file. + +If your project builds more than one application, you will have to do a bit +more. For each of your target applications, you need a seperate rule. + +If you want the created bundles to be installed, you may want to add this +rule to your Makefile.am: + +install-exec-hook: APP_NAME_bundle + rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app + mkdir -p $(DESTDIR)$(prefix)/Applications/ + cp -r $< /$(DESTDIR)$(prefix)Applications/ + +This rule takes the Bundle created by the rule from step 3 and installs them +into $(DESTDIR)$(prefix)/Applications/. + +Again, if you want to install multiple applications, you will have to augment +the make rule accordingly. + + +But beware! That is only part of the story! With the above, you end up with +a bare bone .app bundle, which is double clickable from the Finder. But +there are some more things you should do before shipping yor product... + +1) The bundle right now probably is dynamically linked against SDL. That + means that when you copy it to another computer, *it will not run*, + unless you also install SDL on that other computer. A good solution + for this dilemma is to static link against SDL. On OS X, you can + achieve that by linkinag against the libraries listed by + sdl-config --static-libs + instead of those listed by + sdl-config --libs + Depending on how exactly SDL is integrated into your build systems, the + way to achieve that varies, so I won't describe it here in detail +2) Add an 'Info.plist' to your application. That is a special XML file which + contains some meta-information about your application (like some copyright + information, the version of your app, the name of an optional icon file, + and other things). Part of that information is displayed by the Finder + when you click on the .app, or if you look at the "Get Info" window. + More information about Info.plist files can be found on Apple's homepage. + + +As a final remark, let me add that I use some of the techniques (and some +variations of them) in Exult and ScummVM; both are available in source on +the net, so feel free to take a peek at them for inspiration! + + +============================================================================== +Using the Simple DirectMedia Layer with Xcode +============================================================================== + +These instructions are for using Apple's Xcode IDE to build SDL applications. + +- First steps + +The first thing to do is to unpack the Xcode.tar.gz archive in the +top level SDL directory (where the Xcode.tar.gz archive resides). +Because Stuffit Expander will unpack the archive into a subdirectory, +you should unpack the archive manually from the command line: + cd [path_to_SDL_source] + tar zxf Xcode.tar.gz +This will create a new folder called Xcode, which you can browse +normally from the Finder. + +- Building the Framework + +The SDL Library is packaged as a framework bundle, an organized +relocatable folder heirarchy of executible code, interface headers, +and additional resources. For practical purposes, you can think of a +framework as a more user and system-friendly shared library, whose library +file behaves more or less like a standard UNIX shared library. + +To build the framework, simply open the framework project and build it. +By default, the framework bundle "SDL.framework" is installed in +/Library/Frameworks. Therefore, the testers and project stationary expect +it to be located there. However, it will function the same in any of the +following locations: + + ~/Library/Frameworks + /Local/Library/Frameworks + /System/Library/Frameworks + +- Build Options + There are two "Build Styles" (See the "Targets" tab) for SDL. + "Deployment" should be used if you aren't tweaking the SDL library. + "Development" should be used to debug SDL apps or the library itself. + +- Building the Testers + Open the SDLTest project and build away! + +- Using the Project Stationary + Copy the stationary to the indicated folders to access it from + the "New Project" and "Add target" menus. What could be easier? + +- Setting up a new project by hand + Some of you won't want to use the Stationary so I'll give some tips: + * Create a new "Cocoa Application" + * Add src/main/macosx/SDLMain.m , .h and .nib to your project + * Remove "main.c" from your project + * Remove "MainMenu.nib" from your project + * Add "$(HOME)/Library/Frameworks/SDL.framework/Headers" to include path + * Add "$(HOME)/Library/Frameworks" to the frameworks search path + * Add "-framework SDL -framework Foundation -framework AppKit" to "OTHER_LDFLAGS" + * Set the "Main Nib File" under "Application Settings" to "SDLMain.nib" + * Add your files + * Clean and build + +- Building from command line + Use pbxbuild in the same directory as your .pbproj file + +- Running your app + You can send command line args to your app by either invoking it from + the command line (in *.app/Contents/MacOS) or by entering them in the + "Executibles" panel of the target settings. + +- Implementation Notes + Some things that may be of interest about how it all works... + * Working directory + As defined in the SDL_main.m file, the working directory of your SDL app + is by default set to its parent. You may wish to change this to better + suit your needs. + * You have a Cocoa App! + Your SDL app is essentially a Cocoa application. When your app + starts up and the libraries finish loading, a Cocoa procedure is called, + which sets up the working directory and calls your main() method. + You are free to modify your Cocoa app with generally no consequence + to SDL. You cannot, however, easily change the SDL window itself. + Functionality may be added in the future to help this. + + +Known bugs are listed in the file "BUGS" diff --git a/README.MiNT b/README.MiNT new file mode 100644 index 0000000..eabe3eb --- /dev/null +++ b/README.MiNT @@ -0,0 +1,250 @@ +============================================================================== +Using the Simple DirectMedia Layer on Atari +============================================================================== + + + If you want to build SDL from sources to create SDL programs on Atari: + see sections I - II. + + If you want to create SDL programs on Atari using SDL binary build, + download it from my web site (URL at end of this file). + + If you want to configure a program using SDL on Atari, + see sections IV - VI. + + +============================================================================== +I. Building the Simple DirectMedia Layer libraries: + (This step isn't necessary if you have the SDL binary distribution) + + Do the classic configure, with --disable-shared --enable-static and: + + Tos version (should run everywhere): + --disable-threads + Tos does not support threads. + + MiNT version (maybe Magic, only for multitasking OS): + --disable-pthreads --enable-pth + Mint and Magic may supports threads, so audio can be used with current + devices, like Sun audio, or disk-writing support. Like Tos, interrupt + audio without threads is more suited for Atari machines. + + Then you can make ; make install it. + +============================================================================== +II. Building the Simple DirectMedia Layer test programs: + + Do the classic configure, then make. + + Run them ! + +============================================================================== +III. Enjoy! :) + + If you have a project you'd like me to know about, or want to ask questions, + go ahead and join the SDL developer's mailing list by sending e-mail to: + + sdl-request@libsdl.org + + and put "subscribe" into the subject of the message. Or alternatively you + can use the web interface: + + http://www.libsdl.org/mailman/listinfo/sdl + +============================================================================== +IV. What is supported: + +Keyboard (GEMDOS, BIOS, GEM, Ikbd) +Mouse (XBIOS, GEM, Ikbd, /dev/mouse (non working atm, disabled)) +Video (XBIOS (Fullscreen), GEM (Windowed and Fullscreen)) +Timer (VBL vector, GNU pth library) +Joysticks and joypads (Ikbd, Hardware) +Audio (Hardware, XBIOS, GSXB, MCSN, STFA, /dev/audio if threads enabled) +Threads (Multitasking OS only via GNU pth library) +Shared object loader (using LDG library from http://ldg.atari.org/) +Audio CD (MetaDOS) +OpenGL (using Mesa offscreen rendering driver) + +- Dependent driver combinations: +Video Kbd Mouse Timer Joysticks +xbios ikbd ikbd vbl(2) ikbd +xbios gemdos xbios vbl(2) xbios +xbios bios xbios vbl(2) xbios +gem gem gem(1) vbl(2) xbios + +Audio O/S Misc +dma8 All Uses MFP Timer A interrupt +xbios TOS Uses MFP Timer A interrupt +xbios MiNT Uses MFP Timer A interrupt +xbios Magic Uses MFP Timer A interrupt +stfa All Uses MFP interrupt +mcsn TOS Uses MFP Timer A interrupt +mcsn MiNT Uses MiNT thread +mcsn Magic Disabled +gsxb All Uses GSXB callback + +Joypad driver always uses hardware access. +OpenGL driver always uses OSMesa. + +(1) GEM does not report relative mouse motion, so xbios mouse driver is used +to report this type event. +A preliminary driver for /dev/mouse device driver is present, but is disabled +till it can be used with other applications simultaneously. + +(2) If you build SDL with threads using the GNU pth library, timers are +supported via the pth library. + +============================================================================== +V. Environment variables: + +SDL_VIDEODRIVER: + Set to 'xbios' to force xbios video driver + Set to 'gem' to force gem video driver + +SDL_VIDEO_GL_DRIVER: + Set to filename to load as OpenGL library, if you use SDL_GL_LoadLibrary() + +SDL_AUDIODRIVER: + Set to 'mint_gsxb' to force Atari GSXB audio driver + Set to 'mint_mcsn' to force Atari MCSN audio driver + Set to 'mint_stfa' to force Atari STFA audio driver + Set to 'mint_xbios' to force Atari Xbios audio driver + Set to 'mint_dma8' to force Atari 8 bits DMA audio driver + Set to 'audio' to force Sun /dev/audio audio driver + Set to 'disk' to force disk-writing audio driver + +SDL_ATARI_EVENTSDRIVER + Set to 'ikbd' to force IKBD 6301 keyboard driver + Set to 'gemdos' to force gemdos keyboard driver + Set to 'bios' to force bios keyboard driver + +SDL_JOYSTICK_ATARI: + Use any of these strings in the environment variable to enable or + disable a joystick: + + 'ikbd-joy1-[on|off]' for IKBD joystick on port 1 (hardware access) + 'xbios-joy1-[on|off]' for IKBD joystick on port 1 (xbios access) + 'porta-pad-[on|off]' for joypad and/or teamtap on port A + 'porta-joy0-[on|off]' for joystick 0 on port A + 'porta-joy1-[on|off]' for joystick 1 on port A + 'porta-lp-[on|off]' for lightpen on port A + 'porta-anpad-[on|off]' for analog paddle on port A + 'portb-pad-[on|off]' for joypad and/or teamtap on port B + 'portb-joy0-[on|off]' for joystick 0 on port B + 'portb-joy1-[on|off]' for joystick 1 on port B + 'portb-anpad-[on|off]' for analog paddle on port B + + Default configuration is: + 'ikbd-joy1-on' (if IKBD events driver enabled) + 'xbios-joy1-on' (if gemdos/bios/gem events driver enabled) + 'porta-pad-on portb-pad-on' (if available on the machine) + + port[a|b]-[pad|joy?|lp|anpad]-* strings are mutually exclusives. + On such a port, you can only use a joypad OR 1 or 2 joysticks OR + a lightpen OR an analog paddle. You must disable joypad before + setting another controller. + + The second joystick port on IKBD is used by the mouse, so not usable. + Another problem with the IKBD: mouse buttons and joystick fire buttons + are wired together at the hardware level, it means: + port 0 port 0 port 1 + mouse left button = joystick fire 0 = joystick fire 1 + mouse right button = joystick fire 1 = joystick fire 0 + + Descriptions of joysticks/joypads: + - Joypads: 1 hat, 17 buttons (Atari Jaguar console-like). + - Joysticks: 1 hat, 1 button. + - Lightpen, analog paddles: 2 axis, 2 buttons. The 2 buttons are those + affected to 1 button joysticks on the same port. + +============================================================================== +VI. More informations about drivers: + +OpenGL: + The default is to use the Mesa offscreen driver (osmesa.ldg). If you want + to use an older OpenGL implementation, like mesa_gl.ldg or tiny_gl.ldg, + your program must use SDL_GL_LoadLibrary() to do so, and retrieve the + needed function pointers with SDL_LoadFunction(). In all cases, the OpenGL + context is taken care of by SDL itself, you just have to use gl* functions. + + However, there is one OpenGL call that has a different prototype in the old + implementations: glOrtho(). In the old implementations, it has 6 float as + parameters, in the standard one, it has 6 double parameters. If you want + to compile testdyngl, or any other SDL program that loads its OpenGL + library, you must change the glOrtho() prototype used in this program. In + osmesa.ldg, you can retrieve a glOrtho() with double parameters, by + searching for the function "glOrtho6d". + +Xbios video: + Video chip is detected using the _VDO cookie. + Screen enhancers are not supported, but could be if you know how to + use them. + + ST, STE, Mega ST, Mega STE: + 320x200x4 bits, shades of grey, available only for the purpose + of testing SDL. + TT: + 320x480x8 and 320x240x8 (software double-lined mode). + Falcon: + All modes supported by the current monitor (RVB or VGA). + BlowUp and Centscreen extended modes, ScreenBlaster 3 current mode. + Milan: + Experimental support + Clones and any machine with monochrome monitor: + Not supported. + +Gem video: + Automatically used if xbios not available. + + All machines: + Only the current resolution, if 8 bits or higher depth. + +IKBD keyboard, mouse and joystick driver: + Available if _MCH cookie is ST, Mega ST, STE, Mega STE, TT or Falcon. + + Hades has an IKBD, but xbios is not available for video, so IKBD + driver is disabled. + +Gemdos and bios keyboard driver: + Available on all machines. + +Mouse and joystick xbios driver: + Available on all machines (I think). + +Joypad driver: + Available if _MCH cookie is STE or Falcon. Supports teamtap. + +PTH timer driver: + Available with multitasking OS. + +VBL timer driver: + Available on all machines (I think). + +Audio drivers: + Cookies _SND, MCSN, STFA and GSXB used to detect supported audio + capabilities. + + STE, Mega STE, TT: + 8 bits DMA (hardware access) + STFA, MCSN or GSXB driver if installed + Falcon: + 8 bits DMA (hardware access) + Xbios functions + STFA, MCSN or GSXB driver if installed + Other machines: + STFA, MCSN or GSXB driver if installed + + STFA driver: + http://removers.free.fr/softs/stfa.html + GSXB driver: + http://assemsoft.atari.org/gsxb/ + MacSound driver: + http://jf.omnis.ch/software/tos/ + MagicSound driver (MCSN,GSXB compatible): + http://perso.wanadoo.fr/didierm/ + X-Sound driver (GSXB compatible): + http://www.uni-ulm.de/~s_thuth/atari/xsound_e.html + +-- +Patrice Mandin +http://pmandin.atari.org/ diff --git a/README.NDS b/README.NDS new file mode 100644 index 0000000..e96a9ee --- /dev/null +++ b/README.NDS @@ -0,0 +1,22 @@ +The SDL port to the Nintendo DS + +This port uses the devKitPro toolchain, available from: +http://www.devkitpro.org + +Precompiled tools for cross-compiling on Linux are available from: +http://www.libsdl.org/extras/nds/devkitPro-20070503-linux.tar.gz + +todo: +add ds console specific features/optimizations +mouse/keyboard support +dual screen support + +build with: +cp include/SDL_config_nds.h include/SDL_config.h +make -f Makefile.ds + +included is an arm9/arm7 template to allow for sound streaming support. + +Enjoy, fix the source and share :) +Troy Davis(GPF) +http://gpf.dcemu.co.uk/ diff --git a/README.NanoX b/README.NanoX new file mode 100644 index 0000000..8418ff3 --- /dev/null +++ b/README.NanoX @@ -0,0 +1,97 @@ + ================================================================= + Patch version 0.9 of SDL(Simple DirectMedia Layer) for Nano-X API + ================================================================= + + Authors: Hsieh-Fu Tsai, clare@setabox.com + Greg Haerr, greg@censoft.com + + This patch is against SDL version 1.2.4. + It enhances previous patch 0.8 by providing direct framebuffer + access as well as dynamic hardware pixel type support, not + requiring a compile-time option setting for different framebuffer + modes. + Tested against Microwindows version 0.89pre9. + + Older Microwindows versions + =========================== + If running on a version older than Microwindows 0.89pre9, + the following items might need to be patched in Microwindows. + + 1. Patch src/nanox/client.c::GrClose() + It fixes the client side GrClose(). In the original version, + GrOpen() can only be called once. When the GrOpen() is called at + the second time, the program will terminate. In order to prevent + this situation, we need to insert "nxSocket = -1" after + "close(nxSocket)" in GrClose(). If you do not have this problem, + you may skip this step. + + 2. Patch src/nanox/clientfb.c to return absolute x,y coordinates + when using GrGetWindowFBInfo(). Copy the version 0.89pre9 + of src/nanox/clientfb.c to your system, or configure + using --disable-nanox-direct-fb. + + ============= + Quick Install + ============= + + 1. ./configure --disable-video-x11 --disable-video-fbcon \ + --enable-video-nanox \ + --with-nanox-pixel-type=[rgb/0888/888/565/555/332/pal] + 2. make clean + 3. make + 4. make install (as root) + + ============ + Nitty-gritty + ============ + + --enable-nanox-direct-fb Use direct framebuffer access + --enable-nanox-debug Show debug messages + --enable-nanox-share-memory Use shared-memory to speed up + + When running multi-threaded applications using SDL, such + as SMPEG, set THREADSAFE=Y in Microwindows' config file, + to enable GrXXX() system call critical section support. + + ============================================= + Some programs can be used to test this patch. + ============================================= + + 1. http://www.cs.berkeley.edu/~weimer/atris (a tetris-like game) + 2. http://www.libsdl.org/projects/newvox/ + 3. http://www.libsdl.org/projects/xflame/ + 4. http://www.libsdl.org/projects/optimum/ + 5. http://www.gnugeneration.com/software/loop/ + 6: http://www.lokigames.com/development/smpeg.php3 (SMPEG version 0.4.4) + + ========= + Todo List + ========= + + 1. Create hardware surface + 2. Create YUVOverlay on hardware + 3. Use OpenGL + 4. Gamma correction + 5. Hide/Change mouse pointer + 6. Better window movement control with direct fb access + 7. Palette handling in 8bpp could be improved + + ===================== + Supporting Institutes + ===================== + + Many thanks to go to Setabox Co., Ltd. and CML (Communication and + Multimedia Laboratory, http://www.cmlab.csie.ntu.edu.tw/) in the + Department of Computer Science and Information Engineering of + National Taiwan University for supporting this porting project. + + Century Embedded Technologies (http://embedded.censoft.com) + for this patch. + + =================== + Contact Information + =================== + + Welcome to give me any suggestion and to report bugs. + My e-mail address : clare@setabox.com or niky@cmlab.csie.ntu.edu.tw + or greg@censoft.com diff --git a/README.OS2 b/README.OS2 new file mode 100644 index 0000000..424b373 --- /dev/null +++ b/README.OS2 @@ -0,0 +1,281 @@ + +=========== +SDL on OS/2 +=========== + +Last updated on May. 17, 2006. + + +1. How to compile? +------------------ + +To compile this, you'll need the followings installed: +- The OS/2 Developer's Toolkit +- The OpenWatcom compiler + (http://www.openwatcom.org) + +First of all, you have to unzip the Watcom-OS2.zip file. This will result in a +file called "makefile" and a file called "setvars.cmd" in this folder (and some +more files...). + +Please edit the second, fourth and fifth lines of setvars.cmd file +to set the folders where the toolkit, the OW compiler and the FSLib are. +You won't need NASM yet (The Netwide Assembler), you can leave that line. +Run setvars.cmd, and you should get a shell in which you can +compile SDL. + +Check the "makefile" file. There is a line in there which determines if the +resulting SDL.DLL will be a 'debug' or a 'release' build. The 'debug' version +is full of printf()'s, so if something goes wrong, its output can help a lot +for debugging. + +Then run "wmake". +This should create the SDL12.DLL and the corresponding SDL12.LIB file here. + +To test applications, it's a good idea to use the 'debug' build of SDL, and +redirect the standard output and standard error output to files, to see what +happens internally in SDL. +(like: testsprite >stdout.txt 2>stderr.txt) + +To rebuild SDL, use the following commands in this folder: +wmake clean +wmake + + + +2. How to compile the testapps? +------------------------------- + +Once you have SDL12.DLL compiled, navigate into the 'test' folder, copy in +there the newly built SDL12.DLL, and copy in there FSLib.DLL. + +Then run "wmake" in there to compile some of the testapps. + + + +3. What is missing? +------------------- + +The following things are missing from this SDL implementation: +- MMX, SSE and 3DNOW! optimized video blitters? +- HW Video surfaces +- OpenGL support + + + +4. Special Keys / Full-Screen support +------------------------------------- + +There are two special hot-keys implemented: +- Alt+Home switches between fullscreen and windowed mode +- Alt+End simulates closing the window (can be used as a Panic key) +Only the LEFT Alt key will work. + + + +5. Joysticks on SDL/2 +--------------------- + +The Joystick detection only works for standard joysticks (2 buttons, 2 axes +and the like). Therefore, if you use a non-standard joystick, you should +specify its features in the SDL_OS2_JOYSTICK environment variable in a batch +file or CONFIG.SYS, so SDL applications can provide full capability to your +device. The syntax is: + +SET SDL_OS2_JOYSTICK=[JOYSTICK_NAME] [AXES] [BUTTONS] [HATS] [BALLS] + +So, it you have a Gravis GamePad with 4 axes, 2 buttons, 2 hats and 0 balls, +the line should be: + +SET SDL_OS2_JOYSTICK=Gravis_GamePad 4 2 2 0 + +If you want to add spaces in your joystick name, just surround it with +quotes or double-quotes: + +SET SDL_OS2_JOYSTICK='Gravis GamePad' 4 2 2 0 + +or + +SET SDL_OS2_JOYSTICK="Gravis GamePad" 4 2 2 0 + + Notive However that Balls and Hats are not supported under OS/2, and the +value will be ignored... but it is wise to define these correctly because +in the future those can be supported. + Also the number of buttons is limited to 2 when using two joysticks, +4 when using one joystick with 4 axes, 6 when using a joystick with 3 axes +and 8 when using a joystick with 2 axes. Notice however these are limitations +of the Joystick Port hardware, not OS/2. + + + +6. Proportional windows +----------------------- + +For some SDL applications it can be handy to have proportional windows, so +the windows will keep their aspect ratio when resized. +This can be achieved in two ways: + +- Before starting the given SDL application, set the + SDL_USE_PROPORTIONAL_WINDOW environment variable to something, e.g.: + + SET SDL_USE_PROPORTIONAL_WINDOW=1 + dosbox.exe + +- If you have a HOME environment variable set, then SDL will look for a file + in there called ".sdl.proportionals". If that file contains the name of the + currently running SDL executable, then that process will have proportional + windows automatically. + + Please note that this file is created automatically with default values + at the first run. + + + +7. Audio in SDL applications +---------------------------- + +Audio effects are one of the most important features in games. Creating audio +effects in sync with the game and without hickups and pauses in the audio are +very important things. + +However there are multithreaded SDL applications that have tight loops as their +main logic loop. This kills performance in OS/2, and takes too much CPU from +other threads in the same process, for example from the thread to create the +sound effects. + +For this reason, the OS/2 port of SDL can be instructed to run the audio thread +in high priority, which makes sure that there will be enough time for the +processing of the audio data. + +At default, SDL/2 runs the audio thread at ForegroundServer+0 priority. Well +written and well behaving SDL applications should work well in this mode. +For other applications, you can tell SDL/2 to run the audio thread at +TimeCritical priority by setting an env.variable before starting the SDL app: + + SET SDL_USE_TIMECRITICAL_AUDIO=1 + +Please note that this is a bit risky, because if the SDL application runs a +tight infinite loop in this thread, this will make the whole system +unresponsive, so use it with care, and only for applications that need it! + + + +8. Next steps... +---------------- + +Things to do: +- Implement missing stuffs (look for 'TODO' string in source code!) +- Finish video driver (the 'wincommon' can be a good example for missing + things like application icon and so on...) +- Enable MMX/SSE/SSE2 acceleration functions +- Rewrite CDROM support using DOS Ioctl for better support. + + + +9. Contacts +----------- + + You can contact the developers for bugs: + + Area Developer email + General (Audio/Video/System) Doodle doodle@scenergy.dfmk.hu + CDROM and Joystick Caetano daniel@caetano.eng.br + + Notice however that SDL/2 is 'in development' stage so ... if you want to help, +please, be our guest and contact us! + + + +10. Changelog of the OS/2 port +------------------------------ + +Version 1.2.10 - 2006-05-17 - Doodle + - Small modifications for v1.2.10 release + - Changed DLL name to include version info (currently SDL12.dll) + +Version 1.2 - 2006-05-01 - Doodle + - Modified makefile system to have only one makefile + - Included FSLib headers, DLL and LIB file + +Version 1.2 - 2006-02-26 - Doodle + - Updated the official SDL version with the OS/2 specific changes. + - Added support for real unicode keycode conversion. + +Version 1.2.7 - 2006-01-20 - Doodle + - Added support for selectively using timecritical priority for + audio threads by SDL_USE_TIMECRITICAL_AUDIO environment variable. + (e.g.: + SET SDL_USE_TIMECRITICAL_AUDIO=1 + dosbox.exe + ) + +Version 1.2.7 - 2005-12-22 - Doodle + - Added support for proportional SDL windows. + There are two ways to have proportional (aspect-keeping) windows for + a given SDL application: Either set the SDL_USE_PROPORTIONAL_WINDOW + environment variable to something before starting the application + (e.g.: + SET SDL_USE_PROPORTIONAL_WINDOW=1 + dosbox.exe + ) + or, if you have the HOME environment variable set, then SDL12.DLL will + create a file in that directory called .sdl.proportionals, and you can + put there the name of executable files that will be automatically made + proportional. + +Version 1.2.7 - 2005-10-14 - Doodle + - Enabled Exception handler code in FSLib to be able to restore original + desktop video mode in case the application crashes. + - Added the missing FSLib_Uninitialize() call into SDL. + (The lack of it did not cause problems, but it's cleaner this way.) + - Fixed a mouse problem in Fullscreen mode where any mouse click + re-centered the mouse. + +Version 1.2.7 - 2005-10-09 - Doodle + - Implemented window icon support + +Version 1.2.7 - 2005-10-03 - Doodle + - Reworked semaphore support again + - Tuned thread priorities + +Version 1.2.7 - 2005-10-02 - Doodle + - Added support for custom mouse pointers + - Fixed WM_CLOSE processing: give a chance to SDL app to ask user... + - Added support for MMX-accelerated audio mixers + - Other small fixes + +Version 1.2.7 - 2005-09-12 - Doodle + - Small fixes for DosBox incorporated into public release + - Fixed semaphore support (SDL_syssem.c) + - Fixed FSLib to have good clipping in scaled window mode, + and to prevent occasional desktop freezes. + +Version 1.2.7 - 2004-09-08a - Caetano + - Improved joystick support (general verifications about hardware). + - Added support up to 8 buttons in 2 axes joysticks and 6 buttons in 3 axes joysticks. + - Added support to environment variable SDL_OS2_JOYSTICK to specify a joystick. + - Improved Joystick test to handle every type of joystick and display only relevant information. + - Merged with Doodle 2004-09-08 + - Little tid up in README.OS2 + - Added explanation about SDL_OS2_JOYSTICK environment variable on README.OS2 + +Version 1.2.7 - 2004-09-07 - Caetano + - Merged with changes in headers for GCC compiling. + - Added Joystick support using basic IBM GAME$ support, allowing it to work with all joystick drivers since OS/2 2.1. + - Improved joystick detection (hacked!). OS/2 do not allow real joystick detection, so... + - Modified makefile in test to compile "testjoystick". Anyway, it's useless, since it seems to cause a lot of trouble in OS/2 (because os video routines, not Joystick support). + - Created separated Joystick test program to test only joystick functions. + - Improved joystick auto-centering. + - Improved the coordinate correction routine to use two scale factors for each axis. + +Version 1.2.7 - 2004-07-05 - Caetano + - Corrected the time returned by status in CDROM support (it was incorrect) + - Added the testcdrom.c and corrected the linking directive (it was causing an error) + +Version 1.2.7 - 2004-07-02a - Caetano + - Corrected a little problem in a comment at SDL-1.2.7\test\torturethread.c, line 18 (missing */, nested comment) + - Added CDROM support to tree (SDL-1.2.7\src\cdrom\os2\SDL_syscdrom.c) + - Modified makefile (SDL-1.2.7\src\makefiles.wat and SDL-1.2.7\watcom.mif) to build with CDROM support + - Added the "extra" SDL_types.h forgotten in 2004-07-02 version. + + diff --git a/README.PS3 b/README.PS3 new file mode 100644 index 0000000..c66467d --- /dev/null +++ b/README.PS3 @@ -0,0 +1,29 @@ + +SDL on Sony Playstation3 +------------------------ + +Installation: + First, you have to install the Cell SDK + - Download the Cell SDK installer RPM and ISO images to + a temporary directory such as /tmp/cellsdk. + - Mount the image: mount -o loop CellSDK-Devel-Fedora_3.1.0.0.0.iso /tmp/cellsdk + - Install the SDK installer: rpm -ivh cell-install-3.1.0-0.0.noarch.rpm + - Install the SDK: cd /opt/cell && ./cellsdk --iso /tmp/cellsdkiso install + + You need to install the SPU-libs before installing SDL + - Go to SDL-1.2/src/video/ps3/spulibs/ + - Run make && make install + + Finally, install SDL + - Go to SDL-1.2/ and build SDL like any other GNU style package. + e.g. + - Build the configure-script with ./autogen.sh + - Configure SDL for your needs: ./configure --enable-video-ps3 ... + - Build and install it: make && make install + + +Todo: + - mouse/keyboard/controller support + +Have fun! + Dirk Herrendoerfer diff --git a/README.PicoGUI b/README.PicoGUI new file mode 100644 index 0000000..cdb6bed --- /dev/null +++ b/README.PicoGUI @@ -0,0 +1,50 @@ + ======================== + Using SDL with PicoGUI + ======================== + +- Originally contributed by Micah Dowty + +PicoGUI is a scalable GUI system with a unique architecture, primarily focused +on scalability to various embedded systems. You can find more information +including a FAQ at http://picogui.org + +To use the patch: + + 1. When compiling, add the "--enable-video-picogui" switch to ./configure + + 2. When running your program, ensure that the picogui driver for SDL + is in use by setting the SDL_VIDEODRIVER environment variable + to "picogui". + + 3. The program must also be linked to the C client library for PicoGUI + (libpgui.so). If the program is being compiled with a patched SDL + installed this should be done automatically. If you want to use an + existing binary with PicoGUI, you can set the LD_PRELOAD environment + variable to the path of your libpgui.so file. + +Capabilities: + + So far only basic functionality is provided on true color (linear16/24/32) + devices. Accessing a memory mapped bitmap, updating the display, and handling + mouse/keyboard input. This functionality has been tested with several + applications, including mplayer, Xine, sldroids, and Abuse. + +TODO list: + + - YUV overlays will be helpful for watching video on set top boxes or other + embedded devices that have some graphics acceleration hardware + + - Account for rotated bitmap storage in pgserver + + - Support for hiding or changing the cursor + + - The display should be centered when the SDL application is smaller + than the PicoGUI panel + + - Fullscreen or any other special modes + + - Support for indexed and grayscale modes + + - Probably much more... + +--- The End --- diff --git a/README.Porting b/README.Porting new file mode 100644 index 0000000..df61993 --- /dev/null +++ b/README.Porting @@ -0,0 +1,56 @@ + +* Porting To A New Platform + + The first thing you have to do when porting to a new platform, is look at +include/SDL_platform.h and create an entry there for your operating system. +The standard format is __PLATFORM__, where PLATFORM is the name of the OS. +Ideally SDL_platform.h will be able to auto-detect the system it's building +on based on C preprocessor symbols. + +There are two basic ways of building SDL at the moment: + +1. The "UNIX" way: ./configure; make; make install + + If you have a GNUish system, then you might try this. Edit configure.in, + take a look at the large section labelled: + "Set up the configuration based on the target platform!" + Add a section for your platform, and then re-run autogen.sh and build! + +2. Using an IDE: + + If you're using an IDE or other non-configure build system, you'll probably + want to create a custom SDL_config.h for your platform. Edit SDL_config.h, + add a section for your platform, and create a custom SDL_config_{platform}.h, + based on SDL_config.h.minimal and SDL_config.h.in + + Add the top level include directory to the header search path, and then add + the following sources to the project: + src/*.c + src/audio/*.c + src/cdrom/*.c + src/cpuinfo/*.c + src/events/*.c + src/file/*.c + src/joystick/*.c + src/stdlib/*.c + src/thread/*.c + src/timer/*.c + src/video/*.c + src/audio/disk/*.c + src/video/dummy/*.c + src/joystick/dummy/*.c + src/cdrom/dummy/*.c + src/thread/generic/*.c + src/timer/dummy/*.c + src/loadso/dummy/*.c + + +Once you have a working library without any drivers, you can go back to each +of the major subsystems and start implementing drivers for your platform. + +If you have any questions, don't hesitate to ask on the SDL mailing list: + http://www.libsdl.org/mailing-list.php + +Enjoy! + Sam Lantinga (slouken@libsdl.org) + diff --git a/README.QNX b/README.QNX new file mode 100644 index 0000000..995afbe --- /dev/null +++ b/README.QNX @@ -0,0 +1,155 @@ +README.QNX by Mike Gorchak , +Last changed at 24 Apr 2004. + +====================================================================== +Table of Contents: + +1. OpenGL. +2. Wheel and multi-button mouses. +3. CDROM handling issues. +4. Hardware video overlays. +5. Shared library building. +6. Some building issues. +7. Environment variables. + +====================================================================== +1. OpenGL: + + OpenGL works well and is stable, but fullscreen mode has not been +heavily tested yet. + If you have QNX RtP version 6.1.0 or above you must download the +Photon3D runtime from http://developers.qnx.com or install it from the +public repository or from the public CD, available with QNX. OS versi- +ons below 6.1.0 are not supported. + When creating an OpenGL context, software renderer mode is artifi- +cially selected (QSSL made acceleration only for Voodoo boards in +fullscreen mode, sorry but I don't have this board to test OpenGL - +maybe it works or maybe not :)). If you want acceleration - you can +remove one line in the source code: find the file SDL_ph_image.c and +remove the following + + OGLAttrib[OGLargc++]=PHOGL_ATTRIB_FORCE_SW; + +line in the ph_SetupOpenGLContext() function or change the argument to +PHOGL_ATTRIB_FORCE_HW or PHOGL_ATTRIB_FAVOR_HW. + +====================================================================== +2. Wheel and multi-button mouses: + + Photon emits keyboard events (key up and down) when the mouse +wheel is moved. The key_scan field appears valid, and it contains zero. +That is a basic method of detecting mouse wheel events under Photon. +It looks like a hack, but it works for me :) on various PC configura- +tions. + +I've tested it on: + +1. Genius Optical NetScroll/+ PS/2 (1 wheel) +2. A4Tech Optical GreatEye WheelMouse PS/2, model: WOP-35. (2 wheels + + 2 additional buttons). The wheel for vertical scrolling works as + usual, but the second wheel for horizontal scrolling emits two se- + quential events up or down, so it can provide faster scrolling than + the first wheel. Additional buttons don't emit any events, but it + looks like they're handled by photon in an unusual way - like click + to front, but works not with any window, looks like a fun bug-o-fe- + ature :). + +====================================================================== +3. CDROM handling issues: + + Access to CDROM can only be provided with 'root' privileges. I +can't do anything about that, /dev/cd0 has brw------- permissions and +root:root rights. + +====================================================================== +4. Hardware video overlays: + + Overlays can flicker during window movement, resizing, etc. It +happens because the photon driver updates the real window contents be- +hind the overlay, then draws the temporary chroma key color over the +window contents. It can be done without using the chroma key but that +causes the overlay to always be on top. So flickering during window +movement is preferred instead. + Double buffering code is temporarily disabled in the photon driver +code, because on my GF2-MX it can accidentally cause a buffer switch, +which causes the old frame to show. S3 Savage4 has the same problem, +but ATI Rage 128 doesn't. I think it can be fixed later. Current code +works very well, so maybe double buffering is not needed right now. + Something strange happens when you try to move the window with the +overlay beyond the left border of the screen. The overlay tries to +stay at position x=0, but when attempting to move it a bit more it +jumps to position x=-60 (on GF2-MX, on ATI Rage128 this value a bit +smaller). It's really strange, looks like the overlay doesn't like +negative coordinates. + +======================================================================= +5. Shared library building: + + A shared library can be built, but before running the autogen.sh +script you must manually delete the libtool.m4 stuff from the acinclu- +de.m4 file (it comes after the ESD detection code up to the end of the +file), because the libtool stuff in the acinclude.m4 file was very old +in SDL distribution before the version 1.2.7 and doesn't knew anything +about QNX. SDL 1.2.7 distribution contains the new libtool.m4 script, +but anyway it is broken :), Just remove it, then run "libtoolize +--force --copy", delete the file aclocal.m4 if it is exists and after +that run the autogen.sh script. SDL 1.2.8 contains fixed libtool.m4, +ltmain.sh and config.sub files, so you can just run the autogen.sh +script. + +====================================================================== +6. Some building issues: + + Feel free to not use the --disable-shared configure option if you' +ve read the above comment about 'Shared library building'. Otherwise +this option is strongly recommended, as without it the sdl-config +script will be broken. + + Run the configure script without x11 support, e.g.: + + a) for OpenGL support: + ./configure --prefix=/usr \ + --disable-video-x11 \ + --disable-shared + + b) without OpenGL support: + ./configure --prefix=/usr \ + --disable-video-x11 \ + --disable-shared \ + --disable-video-opengl + + And of course dont forget to specify --disable-debug, which is on +by default, to disable debug and enable the expensive optimizations. + + In the test directory also run the ./configure script without +x11 support, e.g.: + + ./configure --with-sdl-prefix=/usr \ + --with-sdl-exec-prefix=/usr \ + --prefix=/usr --without-x + +====================================================================== +7. Environment variables: + + Please note that the photon driver is sensible to the following +environmental variables: + + * SDL_PHOTON_FULLSCREEN_REFRESH - this environment variable controls +the refresh rate in all fullscreen modes. Be carefull !!! Photon +drivers usually do not checking the maximum refresh rate, which video +adapter or monitor supports. + + * SDL_VIDEO_WINDOW_POS - can be set in the "X,Y" format. If X and Y +coordinates are bigger than the current desktop resolution, then win- +dow positioning across virtual consoles is activated. If X and Y are +smaller than the desktop resolution then window positioning in the +current console is activated. The word "center" can be used instead of +coordinates, it produces the same behavior as SDL_VIDEO_CENTERED +environmental variable. + + * SDL_VIDEO_CENTERED - if this environmental variable exists then the +window centering is perfomed in the current virtual console. + +Notes: The SDL_VIDEO_CENTERED enviromental variable has greater pri- +ority than the SDL_VIDEO_WINDOW_POS in case if both variables are sup- +plied to the application. diff --git a/README.Qtopia b/README.Qtopia new file mode 100644 index 0000000..01627d1 --- /dev/null +++ b/README.Qtopia @@ -0,0 +1,84 @@ + +============================================================================== +Using the Simple DirectMedia Layer with Qtopia/OPIE +============================================================================== + +============================================================================== +I. Setting up the Qtopia development environment. + + This document will not explain how to setup the Qtopia development + environment. That is outside the scope of the document. You can read + more on this subject in this excellent howto: + + http://www.zauruszone.com/howtos/linux_compiler_setup_howto.html + +============================================================================== +II. Building the Simple DirectMedia Layer libraries using the arm + cross-compiler + + This is somewhat tricky since the name of the compiler binaries + differ from the standard. Also you should disable features not + needed. The command below works for me. Note that it's all one + line. You can also set the NM, LD etc environment variables + separately. + + NM=arm-linux-nm LD=arm-linux-ld CC=arm-linux-gcc CXX=arm-linux-g++ RANLIB=arm-linux-ranlib AR=arm-linux-ar ./configure --enable-video-qtopia --disable-video-dummy --disable-video-fbcon --disable-video-dga --disable-arts --disable-esd --disable-alsa --disable-cdrom --disable-video-x11 --disable-nasm --prefix=/opt/Qtopia/sharp/ arm-unknown-linux-gnu + + One thing to note is that the above configure will include joystick + support, even though you can't have joysticks on the Zaurus. The + reason for this is to avoid link / compile / runtime errors with + applications that have joystick support. + +============================================================================== +III. Building the Simple DirectMedia Layer test programs: + + After installing, making sure the correct sdl-config is in your + path, run configure like this: + + NM=arm-linux-nm LD=arm-linux-ld CC=arm-linux-gcc CXX=arm-linux-g++ AR=arm-linux-ar ./configure arm-unknown-linux-gnu + +============================================================================== +IV. Application porting notes + + One thing I have noticed is that applications sometimes don't exit + correctly. Their icon remains in the taskbar and they tend to + relaunch themselves automatically. I believe this problem doesn't + occur if you exit your application using the exit() method. However, + if you end main() with 'return 0;' or so, this seems to happen. + + Also note that when running in landscape mode - i.e requesting a + window that is HEIGHT pixels wide and WIDTH pixels high, where WIDTH + and HEIGHT normally is 240 and 320 - the image is blitted so that + the hardware buttons are on the left side of the display. This might + not always be desirable but such is the code today. + + +============================================================================== +V. Enjoy! :) + + If you have a project you'd like me to know about, or want to ask questions, + go ahead and join the SDL developer's mailing list by sending e-mail to: + + sdl-request@libsdl.org + + and put "subscribe" into the subject of the message. Or alternatively you + can use the web interface: + + http://www.libsdl.org/mailman/listinfo/sdl + +============================================================================== +VI. What is supported: + +Keyboard (Sharp Zaurus) +Hardware buttons +Stylus input (mouse) +Video. Allows fullscreen both in portrait mode (up to WIDTHxHEIGHT +size window) and in landscape mode (up to HEIGHTxWIDTH). + +All other SDL functionality works like a normal Linux system (threads, +audio etc). + +-- +David Hedbor +http://david.hedbor.org/ http://eongames.com/ + diff --git a/README.RISCOS b/README.RISCOS new file mode 100644 index 0000000..1ab8598 --- /dev/null +++ b/README.RISCOS @@ -0,0 +1,130 @@ +Readme for RISC OS port of SDL +============================== + +This document last updated on 2nd Februrary 2006 + +This is a RISC OS port of the Simple Direct Media Layer (SDL) by Alan Buckley with contributions from Peter Naulls. + +Details of the SDL can be found at http://www.libsdl.org. + +The source code including the RISC OS version can be obtained from: + +http://www.libsdl.org. + +Pre built libraries and many games and applications compiled for RISC OS using this library can be downloaded from The Unix Porting Project at http://www.riscos.info/unix/. + +This is released under the LGPL see the file COPYING for details. + + +Compiling applications under RISC OS +==================================== + +Add -ISDL: for the C compiler flags if you include the files in the SDL directory. e.g. #include "SDL/SDL.h" +Add -ISDL:SDL for the C compiler flags if you include the files directly. e.g. #include "SDL/SDL.h" + +Add -LSDL: -lSDL to the link stage of compilation. + +For example, to compile the testbitmap.c sample you could use: + +gcc -ISDL:SDL -LSDL: -lSDL testbitmap.c -otestbitmap + + +RISC OS port of SDL runtime information +======================================= + +Runtime requirements +-------------------- + +This library currently needs a minimum of RISC OS 3.6. The source code for the library (and a lot of the programs built with it) also need long file names. + +To use the audio you also need 16 bit sound and to have installed the DigitalRender module by Andreas Dehmel version 0.51 available from his +web site: http://home.t-online.de/~zarquon +This is loaded when needed by UnixLib. + +Note: As most programs ported from other OSes use high resolution graphics and a memory back buffer a machine with a StrongARM processor and 1 or 2MB of VRAM (or a better machine) is recomended. + + +RISC OS runtime parameters +-------------------------- + +Several environmental variables have been defined to make porting programs easier (i.e. By setting these variable you do not need to have source code differences between OSes). + +They are all defined on an application basis. + +The used below is found as follows: +1. Use the name of the program unless it is !RunImage +2. Check the folder specification for the folder !RunImage is run from. If it is a folder name use that name, otherwise if it is an environmental variable of the form use the value of XXX. + +The variables are: + +SDL$$TaskName + +The name of the task for RISC OS. If omitted then is used for the task name, + +SDL$$BackBuffer + +Set to 1 to use a system memory back buffer for the screen in full screen mode. Some programs on other systems assume their is always a back buffer even though the SDL specification specifies this is not the case. The current RISC OS implementation uses direct writes to the screen if a hardware fullscreen is requested. + +Set to 2 to use an ARM code full word copy. This is faster than the standard back buffer, but uses aligned words only so it is possible (but unlikely) for it to corrupt the screen for 8bpp and 16bpp modes. + +Set to 3 to use a RISC OS sprite as the back buffer. This is usually the slowest for most SDL applications, however it may be useful in the future as Sprite acceleration is added to various hardware that runs RISC OS. + +SDL$$CloseAction - set the action for the close icon. Again as programs don't match the specification you can set this to 0 to remove the close icon from the main window for applications where this does not affect the program. + + +RISC OS SDL port API notes +========================== + +Current level of implementation +------------------------------- + +The following list is an overview of how much of the SDL is implemented. The areas match the main areas of the SDL. + +video - Mostly done. Doesn't cover gamma, YUV-overlay or OpenGL. +Window Manager - Mostly done. SetIcon/IconifyWindow not implemented. +Events - Mostly done. Resize and some joystick events missing. +Joystick - Currently assumes a single joystick with 4 buttons. +Audio - Done +CDROM - Not implemented. +Threads - Done +Timers - Done + +Thread support can be removed by defining DISABLE_THREADS and recompiling the library. + +SDL API notes +------------- + +This section contains additional notes on some specific commands. + +SDL_SetVideoMode + On RISC OS a fullscreen mode directly accesses the screen. This can be modified by the environmental variable (SDL$$BackBuffer) or by using the SDL_SWSURFACE flag to write to an offscreen buffer that is updated using SDL_UpdateRects. + Open GL is not supported so SDL_OPENGL and SDL_OPENGLBLIT flags fail. + SDL_RESIZEABLE and SDL_NOFRAME flags are not supported. + +SDL_SetColors + In a wimp mode the screen colours are not changed for a hardware palette instead the RISC OS sprite colour mapping is used to get the best matching colours. + +SDL_CreateCursor + Inverted colour is not supported. + +SDL_WM_ToggleFullScreen + Currently this won't work if the application starts up in Fullscreen mode. + Toggling to fullscreen will only work if the monitor is set up to support the exact screen size requested. + +SDL_EnableUNICODE + Unicode translation used here is only really accurate for 7 bit characters. + +SDL_NumJoysticks/JoystickName etc. + Hardcoded to expect only 1 joystick with 4 buttons if the Joystick module is loaded. + +SDL_GetTicks + Timer used has only a centisecond accuracy. This applies to other time related functions. + +SDL_Delay + Modified to poll keyboard/mouse during the delay on the event thread. + + +Notes on current implementation +------------------------------- + +Keyboard and mouse are polled so if too long a time is spent between a call to SDL_PumpEvents, functions that use it, or SDL_Delay events can be missed. diff --git a/README.SVN b/README.SVN new file mode 100644 index 0000000..65c5c42 --- /dev/null +++ b/README.SVN @@ -0,0 +1,23 @@ + +The latest development version of SDL is available via Subversion. +Subversion allows you to get up-to-the-minute fixes and enhancements; +as a developer works on a source tree, you can use svn to mirror that +source tree instead of waiting for an official release. Please look +at the Subversion website ( http://subversion.tigris.org/ ) for more +information on using svn, where you can also download software for +MacOS, Windows, and Unix systems. + + svn checkout http://svn.libsdl.org/branches/SDL-1.2 + +If you are building SDL with an IDE, you will need to copy the file +include/SDL_config.h.default to include/SDL_config.h before building. + +If you are building SDL via configure, you will need to run autogen.sh +before running configure. + +There is a web interface to the subversion repository at: + http://www.libsdl.org/cgi/viewvc.cgi + +There is an RSS feed available at that URL, for those that want to +track commits in real time. + diff --git a/README.Symbian b/README.Symbian new file mode 100644 index 0000000..32d925a --- /dev/null +++ b/README.Symbian @@ -0,0 +1,23 @@ +============================================================================== +Using the Simple DirectMedia Layer with S60 3.x / Symbian 9.x +============================================================================== + +These instuctions are for people developing for S60 3.x. S60 3.x +uses Symbian OS so you need S60 SDK. + +extract "symbian.zip" into this folder. + +go to symbian folder + +bldmake bldfiles +abld build + +That produces WINSCW and ARMV5 versions of sdl.dll runtime library +and sdl.lib for development. +The sdlexe.dll/sdlexe.lib and sdlmain.lib are for easy SDL S60 +integration, please see http://www.mbnet.fi/~mertama/sdl.html +for further info. + + + + diff --git a/README.Watcom b/README.Watcom new file mode 100644 index 0000000..2849a11 --- /dev/null +++ b/README.Watcom @@ -0,0 +1,133 @@ + +Using SDL under Windows with the OpenWatcom compiler +==================================================== + +Prerequisites +------------- + +I have done the port under Windows XP Home with SP2 installed. Windows +2000 should also be working. I'm not so sure about ancient Windows NT, +since only DirectX 3 is available there. Building should be possible, +but running the compiled applications will probalbly fail with +SDL_VIDEODRIVER=directx. The windib driver should work, though. + +To compile and use the SDL with Open Watcom you will need the following: +- Open Watcom compiler. I used version 1.5. The environment variables + PATH, WATCOM and INCLUDE need to be set appropriately - please consult + the OpenWatcom documentation and instructions given during the + installation of the compiler. + My setup looks like this in owvars.bat: + set WATCOM=C:\watcom + set INCLUDE=%WATCOM%\h;%WATCOM%\h\nt + set PATH=%PATH%;%WATCOM%\binnt;%WATCOM%\binw +- A fairly recent DirectX SDK. The original unmodified DX8 SDK works, as + well as the minimal DirectX 7 SDK from the Allegro download site + (). +- The SDL sources from Subversion +- The file Watcom-Win32.zip (now available in Subversion) + + +Building the Library +-------------------- + +1) In the SDL base directory extract the archive Watcom-Win32.zip. This + creates a subdirectory named 'watcom'. +2) The makefile expects the environment variable DXDIR to be set to the + base directory of a DirectX SDK. I have tried a stock DX8 SDK from + Microsoft as well as the minimal DirectX 7 SDK from the Allegro + download site. + You can also edit the makefile directly and hard code your path to + the SDK on your system. + I have this in my setup: + set DXDIR=D:\devel\DX8_SDK +3) Enter the watcom directory and run + wmake sdl +4) All tests from the test directory are working and can be built by + running + wmake tests + +Notes: + + The makefile offers some options to tweak the way the library is built. + You have at your disposal the option to build a static (default) + library, or a DLL (with tgt=dll). You can also choose whether to build + a Release (default) or a Debug version (with build=debug) of the tests + and library. Please consult the usage comment at the top of the + makefile for usage instructions. + + If you specify a test target (i.e. 'wmake tests' for all tests, or + selected targets like 'wmake testgl testvidinfo testoverlay2'), the + tests are always freshly compiled and linked. This is done to + minimise hassle when switching between library versions (static vs. + DLL), because they require subtly different options. + Also, the test executables are put directly into the test directory, + so they can find their data files. The clean target of the makefile + removes the test executables and the SDL.dll file from the test + directory. + + To use the library in your own projects with Open Watcom, you can use + the way the tests are built as base of your own build environment. + + The library can also be built with the stack calling convention of the + compiler (-6s instead of -6r). + + +Test applications +----------------- + +I've tried to make all tests work. The following table gives an overview +of the current status. + + Testname Status +~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +checkkeys + +graywin + +loopwave + +testalpha + +testbitmap + +testdyngl + +testerror + +testfile + +testgamma + +testgl + +testhread + +testiconv - (all failed) +testkeys + +testlock + +testoverlay + (needs 'set SDL_VIDEODRIVER=directx') +testoverlay2 + (needs 'set SDL_VIDEODRIVER=directx') +testpalette + +testplatform + +testsem + +testsprite + +testtimer + +testver + +testvidinfo + +testwin ? (fading doesn't seem right) +testwm + +torturethread + +testcdrom + +testjoystick not tested +threadwin + +testcursor + + + +TODO +---- + +There is room for further improvement: +- Test joystick functionality. +- Investigate fading issue in 'testwin' test. +- Fix the UTF-8 support. +- Adapt the makefile/object file list to support more target systems +- Use "#pragma aux" syntax for the CPU info functions. + + +Questions and Comments +---------------------- + +Please direct any questions or comments to me: + + Happy Coding! + + Marc Peter diff --git a/README.WinCE b/README.WinCE new file mode 100644 index 0000000..6f8799e --- /dev/null +++ b/README.WinCE @@ -0,0 +1,55 @@ + +Project files for embedded Visual C++ 3.0, 4.0 and +Visual Studio 2005 can be found in VisualCE.zip + +SDL supports GAPI and WinDib output for Windows CE. + +GAPI driver supports: + +- all possible WinCE devices (Pocket PC, Smartphones, HPC) + with different orientations of video memory and resolutions. +- 4, 8 and 16 bpp devices +- special handling of 8bpp on 8bpp devices +- VGA mode, you can even switch between VGA and GAPI in runtime + (between 240x320 and 480x640 for example). On VGA devices you can + use either GAPI or VGA. +- Landscape mode and automatic rotation of buttons and stylus coordinates. + To enable landscape mode make width of video screen bigger than height. + For example: + SDL_SetVideoMode(320,240,16,SDL_FULLSCREEN) +- WM2005 +- SDL_ListModes + +NOTE: +There are several SDL features not available in the WinCE port of SDL. + +- DirectX is not yet available +- Semaphores are not available +- Joystick support is not available +- CD-ROM control is not available + +In addition, there are several features that run in "degraded" mode: + +Preprocessor Symbol Effect +=================== ================================= + +SDL_systimer.c: +USE_GETTICKCOUNT Less accurate values for SDL time functions +USE_SETTIMER Use only a single marginally accurate timer + +SDL_syswm.c: +DISABLE_ICON_SUPPORT Can't set the runtime window icon + +SDL_sysmouse.c: +USE_STATIC_CURSOR Only the arrow cursor is available + +SDL_sysevents.c: +NO_GETKEYBOARDSTATE Can't get modifier state on keyboard focus + +SDL_dibevents.c: +NO_GETKEYBOARDSTATE Very limited keycode translation + +SDL_dibvideo.c: +NO_GETDIBITS Can't distinguish between 15 bpp and 16 bpp +NO_CHANGEDISPLAYSETTINGS No fullscreen support +NO_GAMMA_SUPPORT Gamma correction not available diff --git a/README.wscons b/README.wscons new file mode 100644 index 0000000..349c89c --- /dev/null +++ b/README.wscons @@ -0,0 +1,107 @@ +============================================================================== +Using the Simple DirectMedia Layer with OpenBSD/wscons +============================================================================== + +The wscons SDL driver can be used to run SDL programs on OpenBSD +without running X. So far, the driver only runs on the Sharp Zaurus, +but the driver is written to be easily extended for other machines. +The main missing pieces are blitting routines for anything but 16 bit +displays, and keycode maps for other keyboards. Also, there is no +support for hardware palettes. + +There is currently no mouse support. + +To compile SDL with support for wscons, use the +"--enable-video-wscons" option when running configure. I used the +following command line: + +./configure --disable-oss --disable-ltdl --enable-pthread-sem \ + --disable-esd --disable-arts --disable-video-aalib \ + --enable-openbsdaudio --enable-video-wscons \ + --prefix=/usr/local --sysconfdir=/etc + + +Setting the console device to use +================================= + +When starting an SDL program on a wscons console, the driver uses the +current virtual terminal (usually /dev/ttyC0). To force the driver to +use a specific terminal device, set the environment variable +SDL_WSCONSDEV: + +bash$ SDL_WSCONSDEV=/dev/ttyC1 ./some-sdl-program + +This is especially useful when starting an SDL program from a remote +login prompt (which is great for development). If you do this, and +want to use keyboard input, you should avoid having some other program +reading from the used virtual console (i.e., do not have a getty +running). + + +Rotating the display +==================== + +The display can be rotated by the wscons SDL driver. This is useful +for the Sharp Zaurus, since the display hardware is wired so that it +is correctly rotated only when the display is folded into "PDA mode." +When using the Zaurus in "normal," or "keyboard" mode, the hardware +screen is rotated 90 degrees anti-clockwise. + +To let the wscons SDL driver rotate the screen, set the environment +variable SDL_VIDEO_WSCONS_ROTATION to "CW", "CCW", or "UD", for +clockwise, counter clockwise, and upside-down rotation respectively. +"CW" makes the screen appear correct on a Sharp Zaurus SL-C3100. + +When using rotation in the driver, a "shadow" frame buffer is used to +hold the intermediary display, before blitting it to the actual +hardware frame buffer. This slows down performance a bit. + +For completeness, the rotation "NONE" can be specified to use a shadow +frame buffer without actually rotating. Unsetting +SDL_VIDEO_WSCONS_ROTATION, or setting it to '' turns off the shadow +frame buffer for maximum performance. + + +Running MAME +============ + +Since my main motivation for writing the driver was playing MAME on +the Zaurus, I'll give a few hints: + +XMame compiles just fine under OpenBSD. + +I'm not sure this is strictly necessary, but set + +MY_CPU = arm + +in makefile.unix, and + +CFLAGS.arm = -DLSB_FIRST -DALIGN_INTS -DALIGN_SHORTS + +in src/unix/unix.max + +to be sure. + +The latest XMame (0.101 at this writing) is a very large program. +Either tinker with the make files to compile a version without support +for all drivers, or, get an older version of XMame. My recommendation +would be 0.37b16. + +When running MAME, DO NOT SET SDL_VIDEO_WSCONS_ROTATION! Performace +is MUCH better without this, and it is COMPLETELY UNNECESSARY, since +MAME can rotate the picture itself while drawing, and does so MUCH +FASTER. + +Use the Xmame command line option "-ror" to rotate the picture to the +right. + + +Acknowledgments +=============== + +I studied the wsfb driver for XFree86/Xorg quite a bit before writing +this, so there ought to be some similarities. + + +-- +Staffan Ulfberg diff --git a/SDL.qpg.in b/SDL.qpg.in new file mode 100644 index 0000000..8e1ff8d --- /dev/null +++ b/SDL.qpg.in @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + QNX.ORG.RU Community + + + QNX.ORG.RU Team + Mike Gorchak + mike@malva.ua + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Library + SDL + 1 + http://qnx.org.ru/repository + 2.6 + + + + Simple DirectMedia Layer (SDL) + SDL + slouken@libsdl.org + Public + public + http://www.libsdl.org + + slouken@libsdl.org + Sam Lantinga + http://www.libsdl.org + + slouken@libsdl.org + + + This is the Simple DirectMedia Layer (SDL), a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms. + This is the Simple DirectMedia Layer (SDL), a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms. This is the libraries, include files and other resources you can use to develop and run SDL applications. + http://www.libsdl.org + + + + + @VERSION@ + Medium + Stable + + + 1 + + GNU Lesser General Public License + + + + Software Development/Libraries and Extensions/C Libraries + SDL,audio,graphics,demos,games,emulators,direct,media,layer + qnx6 + none + Photon + Console + Developer + User + + repdata://LicenseUrl/COPYING + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SDL.spec b/SDL.spec new file mode 100644 index 0000000..fb50531 --- /dev/null +++ b/SDL.spec @@ -0,0 +1,113 @@ +Summary: Simple DirectMedia Layer +Name: SDL +Version: 1.2.14 +Release: 1 +Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz +URL: http://www.libsdl.org/ +License: LGPL +Group: System Environment/Libraries +BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot +Prefix: %{_prefix} +%ifos linux +Provides: libSDL-1.2.so.0 +%endif + +%define __defattr %defattr(-,root,root) +%define __soext so + +%description +This is the Simple DirectMedia Layer, a generic API that provides low +level access to audio, keyboard, mouse, and display framebuffer across +multiple platforms. + +%package devel +Summary: Libraries, includes and more to develop SDL applications. +Group: Development/Libraries +Requires: %{name} = %{version} + +%description devel +This is the Simple DirectMedia Layer, a generic API that provides low +level access to audio, keyboard, mouse, and display framebuffer across +multiple platforms. + +This is the libraries, include files and other resources you can use +to develop SDL applications. + + +%prep +%setup -q + +%build +%ifos linux +CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --disable-video-aalib --disable-video-directfb --disable-video-ggi --disable-video-svga +%else +%configure +%endif +make + +%install +rm -rf $RPM_BUILD_ROOT +%ifos linux +make install prefix=$RPM_BUILD_ROOT%{prefix} \ + bindir=$RPM_BUILD_ROOT%{_bindir} \ + libdir=$RPM_BUILD_ROOT%{_libdir} \ + includedir=$RPM_BUILD_ROOT%{_includedir} \ + datadir=$RPM_BUILD_ROOT%{_datadir} \ + mandir=$RPM_BUILD_ROOT%{_mandir} +ln -s libSDL-1.2.so.0 $RPM_BUILD_ROOT%{_libdir}/libSDL-1.1.so.0 +%else +%makeinstall +%endif + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%{__defattr} +%doc README-SDL.txt COPYING CREDITS BUGS +%{_libdir}/lib*.%{__soext}.* + +%files devel +%{__defattr} +%doc README README-SDL.txt COPYING CREDITS BUGS WhatsNew docs.html +%doc docs/index.html docs/html +%{_bindir}/*-config +%{_libdir}/lib*.a +%{_libdir}/lib*.la +%{_libdir}/lib*.%{__soext} +%dir %{_includedir}/SDL +%{_includedir}/SDL/*.h +%{_libdir}/pkgconfig/sdl.pc +%{_datadir}/aclocal/* +%{_mandir}/man3/* + +%changelog +* Tue May 16 2006 Sam Lantinga +- Removed support for Darwin, due to build problems on ps2linux + +* Mon Jan 03 2004 Anders Bjorklund +- Added support for Darwin, updated spec file + +* Wed Jan 19 2000 Sam Lantinga +- Re-integrated spec file into SDL distribution +- 'name' and 'version' come from configure +- Some of the documentation is devel specific +- Removed SMP support from %build - it doesn't work with libtool anyway + +* Tue Jan 18 2000 Hakan Tandogan +- Hacked Mandrake sdl spec to build 1.1 + +* Sun Dec 19 1999 John Buswell +- Build Release + +* Sat Dec 18 1999 John Buswell +- Add symlink for libSDL-1.0.so.0 required by sdlbomber +- Added docs + +* Thu Dec 09 1999 Lenny Cartier +- v 1.0.0 + +* Mon Nov 1 1999 Chmouel Boudjnah +- First spec file for Mandrake distribution. + +# end of file diff --git a/SDL.spec.in b/SDL.spec.in new file mode 100644 index 0000000..dbda112 --- /dev/null +++ b/SDL.spec.in @@ -0,0 +1,113 @@ +Summary: Simple DirectMedia Layer +Name: SDL +Version: @SDL_VERSION@ +Release: 1 +Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz +URL: http://www.libsdl.org/ +License: LGPL +Group: System Environment/Libraries +BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot +Prefix: %{_prefix} +%ifos linux +Provides: libSDL-1.2.so.0 +%endif + +%define __defattr %defattr(-,root,root) +%define __soext so + +%description +This is the Simple DirectMedia Layer, a generic API that provides low +level access to audio, keyboard, mouse, and display framebuffer across +multiple platforms. + +%package devel +Summary: Libraries, includes and more to develop SDL applications. +Group: Development/Libraries +Requires: %{name} = %{version} + +%description devel +This is the Simple DirectMedia Layer, a generic API that provides low +level access to audio, keyboard, mouse, and display framebuffer across +multiple platforms. + +This is the libraries, include files and other resources you can use +to develop SDL applications. + + +%prep +%setup -q + +%build +%ifos linux +CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --disable-video-aalib --disable-video-directfb --disable-video-ggi --disable-video-svga +%else +%configure +%endif +make + +%install +rm -rf $RPM_BUILD_ROOT +%ifos linux +make install prefix=$RPM_BUILD_ROOT%{prefix} \ + bindir=$RPM_BUILD_ROOT%{_bindir} \ + libdir=$RPM_BUILD_ROOT%{_libdir} \ + includedir=$RPM_BUILD_ROOT%{_includedir} \ + datadir=$RPM_BUILD_ROOT%{_datadir} \ + mandir=$RPM_BUILD_ROOT%{_mandir} +ln -s libSDL-1.2.so.0 $RPM_BUILD_ROOT%{_libdir}/libSDL-1.1.so.0 +%else +%makeinstall +%endif + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%{__defattr} +%doc README-SDL.txt COPYING CREDITS BUGS +%{_libdir}/lib*.%{__soext}.* + +%files devel +%{__defattr} +%doc README README-SDL.txt COPYING CREDITS BUGS WhatsNew docs.html +%doc docs/index.html docs/html +%{_bindir}/*-config +%{_libdir}/lib*.a +%{_libdir}/lib*.la +%{_libdir}/lib*.%{__soext} +%dir %{_includedir}/SDL +%{_includedir}/SDL/*.h +%{_libdir}/pkgconfig/sdl.pc +%{_datadir}/aclocal/* +%{_mandir}/man3/* + +%changelog +* Tue May 16 2006 Sam Lantinga +- Removed support for Darwin, due to build problems on ps2linux + +* Mon Jan 03 2004 Anders Bjorklund +- Added support for Darwin, updated spec file + +* Wed Jan 19 2000 Sam Lantinga +- Re-integrated spec file into SDL distribution +- 'name' and 'version' come from configure +- Some of the documentation is devel specific +- Removed SMP support from %build - it doesn't work with libtool anyway + +* Tue Jan 18 2000 Hakan Tandogan +- Hacked Mandrake sdl spec to build 1.1 + +* Sun Dec 19 1999 John Buswell +- Build Release + +* Sat Dec 18 1999 John Buswell +- Add symlink for libSDL-1.0.so.0 required by sdlbomber +- Added docs + +* Thu Dec 09 1999 Lenny Cartier +- v 1.0.0 + +* Mon Nov 1 1999 Chmouel Boudjnah +- First spec file for Mandrake distribution. + +# end of file diff --git a/TODO b/TODO new file mode 100644 index 0000000..65bb01c --- /dev/null +++ b/TODO @@ -0,0 +1,25 @@ + +Wish list for the 1.3 development branch: +http://bugzilla.libsdl.org/ + + * Add mousewheel events (new unified event architecture?) + * DirectInput joystick support needs to be implemented + * Be able to enumerate and select available audio and video drivers + * Fullscreen video mode support for Mac OS X + * Explicit vertical retrace wait (maybe separate from SDL_Flip?) + * Shaped windows, windows without borders + * Multiple windows, multiple display support + * SDL_INIT_EVENTTHREAD on Windows and MacOS? + * Add a timestamp to events + * Add audio input API + * Add hardware accelerated scaled blit + * Add hardware accelerated alpha blits + * Redesign blitting architecture to allow blit plugins + +In the jump from 1.2 to 1.3, we should change the SDL_Rect members to +int and evaluate all the rest of the datatypes. This is the only place +we should do it though, since the 1.2 series should not break binary +compatibility in this way. + +Requests: + * PCM and CDROM volume control (deprecated, but possible) diff --git a/VisualC.html b/VisualC.html new file mode 100644 index 0000000..ad2ed97 --- /dev/null +++ b/VisualC.html @@ -0,0 +1,171 @@ + + + Using SDL with Microsoft Visual C++ + + +

+ Using SDL with Microsoft Visual C++ 5,6 and 7 +

+

+ by Lion Kimbro and additions by + James Turk +

+

+ You can either use the precompiled libraries from + the SDL Download web site , or you can build SDL yourself. +

+

+ Building SDL +

+

+ Unzip the VisualC.zip file into the directory that contains this + file (VisualC.html). +

+

+ Be certain that you unzip the zip file for your compiler into this + directory and not any other directory. If you are using WinZip, be careful to + make sure that it extracts to this folder, because it's + convenient feature of unzipping to a folder with the name of the file currently + being unzipped will get you in trouble if you use it right now. And that's all + I have to say about that. +

+

+ Now that it's unzipped, go into the VisualC + directory that is created, and double-click on the VC++ file "SDL.dsw" + ("SDL.sln"). This should open up the IDE. +

+

+ You may be prompted at this point to upgrade the workspace, should you be using + a more recent version of Visual C++. If so, allow the workspace to be upgraded. +

+

+ Build the .dll and .lib files. +

+

+ This is done by right clicking on each project in turn (Projects are listed in + the Workspace panel in the FileView tab), and selecting "Build". +

+

+ If you get an error about SDL_config.h being missing, you should + copy include/SDL_config.h.default to include/SDL_config.h and try again. +

+

+ You may get a few warnings, but you should not get any errors. You do have to + have at least the DirectX 5 SDK installed, however. The latest + version of DirectX can be downloaded or purchased on a cheap CD (my + recommendation) from Microsoft . +

+

+ Later, we will refer to the following .lib and .dll files that have just been + generated: +

+
    +
  • SDL.dll
  • +
  • SDL.lib
  • +
  • SDLmain.lib
  • +
+

+ Search for these using the Windows Find (Windows-F) utility, if you don't + already know where they should be. For those of you with a clue, look inside + the Debug or Release directories of the subdirectories of the Project folder. + (It might be easier to just use Windows Find if this sounds confusing. And + don't worry about needing a clue; we all need visits from the clue fairy + frequently.) +

+

+ Creating a Project with SDL +

+

+ Create a project as a Win32 Application. +

+

+ Create a C++ file for your project. +

+

+ Set the C runtime to "Multi-threaded DLL" in the menu: Project|Settings|C/C++ + tab|Code Generation|Runtime Library . +

+

+ Add the SDL include directory to your list of includes in the + menu: Project|Settings|C/C++ tab|Preprocessor|Additional include directories + . +
+ VC7 Specific: Instead of doing this I find it easier to + add the include and library directories to the list that VC7 keeps. Do this by + selecting Tools|Options|Projects|VC++ Directories and under the "Show + Directories For:" dropbox select "Include Files", and click the "New Directory + Icon" and add the [SDLROOT]\include directory (ex. If you installed to + c:\SDL-1.2.5\ add c:\SDL-1.2.5\include). Proceed to change the + dropbox selection to "Library Files" and add [SDLROOT]\lib. +

+

+ The "include directory" I am referring to is the include folder + within the main SDL directory (the one that this HTML file located within). +

+

+ Now we're going to use the files that we had created earlier in the Build SDL + step. +

+

+ Copy the following files into your Project directory: +

+
    +
  • SDL.dll
  • +
+

+ Add the following files to your project (It is not necessary to copy them to + your project directory): +

+
    +
  • SDL.lib
  • +
  • SDLmain.lib
  • +
+

+ (To add them to your project, right click on your project, and select "Add + files to project") +

+

Instead of adding the files to your project it is more + desireable to add them to the linker options: Project|Properties|Linker|Command + Line and type the names of the libraries to link with in the "Additional + Options:" box.  Note: This must be done for each build + configuration (eg. Release,Debug).

+

+ SDL 101, First Day of Class +

+

+ Now create the basic body of your project. The body of your program should take + the following form: +

+#include "SDL.h"
+
+int main( int argc, char* argv[] )
+{
+  // Body of the program goes here.
+  return 0;
+}
+
+ +

+

+ That's it! +

+

+ I hope that this document has helped you get through the most difficult part of + using the SDL: installing it. Suggestions for improvements to this document + should be sent to the writers of this document. +

+

+ Thanks to Paulus Esterhazy (pesterhazy@gmx.net), for the work on VC++ port. +

+

+ This document was originally called "VisualC.txt", and was written by + Sam Lantinga. +

+

+ Later, it was converted to HTML and expanded into the document that you see + today by Lion Kimbro. +

+

Minor Fixes and Visual C++ 7 Information (In Green) was added by James Turk +

+ + diff --git a/VisualC.zip b/VisualC.zip new file mode 100644 index 0000000..5ee0c63 Binary files /dev/null and b/VisualC.zip differ diff --git a/VisualCE.zip b/VisualCE.zip new file mode 100644 index 0000000..0f71254 Binary files /dev/null and b/VisualCE.zip differ diff --git a/Watcom-OS2.zip b/Watcom-OS2.zip new file mode 100644 index 0000000..b3d1a67 Binary files /dev/null and b/Watcom-OS2.zip differ diff --git a/Watcom-Win32.zip b/Watcom-Win32.zip new file mode 100644 index 0000000..c60af6d Binary files /dev/null and b/Watcom-Win32.zip differ diff --git a/WhatsNew b/WhatsNew new file mode 100644 index 0000000..927fdd2 --- /dev/null +++ b/WhatsNew @@ -0,0 +1,727 @@ + +This is a list of API changes in SDL's version history. + +Version 1.0: + +1.2.14: + Added cast macros for correct usage with C++: + SDL_reinterpret_cast(type, expression) + SDL_static_cast(type, expression) + + Added SDL_VIDEO_FULLSCREEN_DISPLAY as a preferred synonym for + SDL_VIDEO_FULLSCREEN_HEAD on X11. + + Added SDL_DISABLE_LOCK_KEYS environment variable to enable normal + up/down events for Caps-Lock and Num-Lock keys. + +1.2.13: + Added SDL_BUTTON_X1 and SDL_BUTTON_X2 constants. + +1.2.12: + Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling + of the screensaver on Mac OS X and X11. + +1.2.10: + If SDL_OpenAudio() is passed zero for the desired format + fields, the following environment variables will be used + to fill them in: + SDL_AUDIO_FREQUENCY + SDL_AUDIO_FORMAT + SDL_AUDIO_CHANNELS + SDL_AUDIO_SAMPLES + If an environment variable is not specified, it will be set + to a reasonable default value. + + Added support for the SDL_VIDEO_FULLSCREEN_HEAD environment + variable, currently supported on X11 Xinerama configurations. + + Added SDL_GL_SWAP_CONTROL to wait for vsync in OpenGL applications. + + Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration. + + Added current_w and current_h to the SDL_VideoInfo structure, + which is set to the desktop resolution during video intialization, + and then set to the current resolution when a video mode is set. + + SDL_SetVideoMode() now accepts 0 for width or height and will use + the current video mode (or the desktop mode if no mode has been set.) + + Added SDL_GetKeyRepeat() + + Added SDL_config.h, with defaults for various build environments. + +1.2.7: + Added CPU feature detection functions to SDL_cpuinfo.h: + SDL_HasRDTSC(), SDL_HasMMX(), SDL_Has3DNow(), SDL_HasSSE(), + SDL_HasAltiVec() + Added function to create RWops from const memory: SDL_RWFromConstMem() + +1.2.6: + Added SDL_LoadObject(), SDL_LoadFunction(), and SDL_UnloadObject() + + Added SDL_GL_MULTISAMPLEBUFFERS and SDL_GL_MULTISAMPLESAMPLES for FSAA + +1.2.5: + Added SDL_BUTTON_WHEELUP (4) and SDL_BUTTON_WHEELDOWN (5) + + Added SDL_GL_STEREO for stereoscopic OpenGL contexts + +1.2.0: + Added SDL_VIDEOEXPOSE event to signal that the screen needs to + be redrawn. This is currently only delivered to OpenGL windows + on X11, though it may be delivered in the future when the video + memory is lost under DirectX. + +1.1.8: + You can pass SDL_NOFRAME to SDL_VideoMode() to create a window + that has no title bar or frame decoration. Fullscreen video + modes automatically have this flag set. + + Added a function to query the clipping rectangle for a surface: + void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect) + + Added a function to query the current event filter: + SDL_EventFilter SDL_GetEventFilter(void) + + If you pass -1 to SDL_ShowCursor(), it won't change the current + cursor visibility state, but will still return it. + + SDL_LockSurface() and SDL_UnlockSurface() are recursive, meaning + you can nest them as deep as you want, as long as each lock call + has a matching unlock call. The surface remains locked until the + last matching unlock call. + + Note that you may not blit to or from a locked surface. + +1.1.7: + The SDL_SetGammaRamp() and SDL_GetGammaRamp() functions now take + arrays of Uint16 values instead of Uint8 values. For the most part, + you can just take your old values and shift them up 8 bits to get + new correct values for your gamma ramps. + + You can pass SDL_RLEACCEL in flags passed to SDL_ConvertSurface() + and SDL will try to RLE accelerate colorkey and alpha blits in the + resulting surface. + +1.1.6: + Added a function to return the thread ID of a specific thread: + Uint32 SDL_GetThreadID(SDL_Thread *thread) + If 'thread' is NULL, this function returns the id for this thread. + +1.1.5: + The YUV overlay structure has been changed to use an array of + pitches and pixels representing the planes of a YUV image, to + better enable hardware acceleration. The YV12 and IYUV formats + each have three planes, corresponding to the Y, U, and V portions + of the image, while packed pixel YUV formats just have one plane. + + For palettized mode (8bpp), the screen colormap is now split in + a physical and a logical palette. The physical palette determines + what colours the screen pixels will get when displayed, and the + logical palette controls the mapping from blits to/from the screen. + A new function, SDL_SetPalette() has been added to change + logical and physical palettes separately. SDL_SetColors() works + just as before, and is equivalent to calling SDL_SetPalette() with + a flag argument of (SDL_LOGPAL|SDL_PHYSPAL). + + SDL_BlitSurface() no longer modifies the source rectangle, only the + destination rectangle. The width/height members of the destination + rectangle are ignored, only the position is used. + + The old source clipping function SDL_SetClipping() has been replaced + with a more useful function to set the destination clipping rectangle: + SDL_bool SDL_SetClipRect(SDL_Surface *surface, SDL_Rect *rect) + + Added a function to see what subsystems have been initialized: + Uint32 SDL_WasInit(Uint32 flags) + + The Big Alpha Flip: SDL now treats alpha as opacity like everybody + else, and not as transparency: + + A new cpp symbol: SDL_ALPHA_OPAQUE is defined as 255 + A new cpp symbol: SDL_ALPHA_TRANSPARENT is defined as 0 + Values between 0 and 255 vary from fully transparent to fully opaque. + + New functions: + SDL_DisplayFormatAlpha() + Returns a surface converted to a format with alpha-channel + that can be blit efficiently to the screen. (In other words, + like SDL_DisplayFormat() but the resulting surface has + an alpha channel.) This is useful for surfaces with alpha. + SDL_MapRGBA() + Works as SDL_MapRGB() but takes an additional alpha parameter. + SDL_GetRGBA() + Works as SDL_GetRGB() but also returns the alpha value + (SDL_ALPHA_OPAQUE for formats without an alpha channel) + + Both SDL_GetRGB() and SDL_GetRGBA() now always return values in + the [0..255] interval. Previously, SDL_GetRGB() would return + (0xf8, 0xfc, 0xf8) for a completely white pixel in RGB565 format. + (N.B.: This is broken for bit fields < 3 bits.) + + SDL_MapRGB() returns pixels in which the alpha channel is set opaque. + + SDL_SetAlpha() can now be used for both setting the per-surface + alpha, using the new way of thinking of alpha, and also to enable + and disable per-pixel alpha blending for surfaces with an alpha + channel: + To disable alpha blending: + SDL_SetAlpha(surface, 0, 0); + To re-enable alpha blending: + SDL_SetAlpha(surface, SDL_SRCALPHA, 0); + Surfaces with an alpha channel have blending enabled by default. + + SDL_SetAlpha() now accepts SDL_RLEACCEL as a flag, which requests + RLE acceleration of blits, just as like with SDL_SetColorKey(). + This flag can be set for both surfaces with an alpha channel + and surfaces with an alpha value set by SDL_SetAlpha(). + As always, RLE surfaces must be locked before pixel access is + allowed, and unlocked before any other SDL operations are done + on it. + + The blit semantics for surfaces with and without alpha and colorkey + have now been defined: + + RGBA->RGB: + SDL_SRCALPHA set: + alpha-blend (using alpha-channel). + SDL_SRCCOLORKEY ignored. + SDL_SRCALPHA not set: + copy RGB. + if SDL_SRCCOLORKEY set, only copy the pixels matching the + RGB values of the source colour key, ignoring alpha in the + comparison. + + RGB->RGBA: + SDL_SRCALPHA set: + alpha-blend (using the source per-surface alpha value); + set destination alpha to opaque. + SDL_SRCALPHA not set: + copy RGB, set destination alpha to opaque. + both: + if SDL_SRCCOLORKEY set, only copy the pixels matching the + source colour key. + + RGBA->RGBA: + SDL_SRCALPHA set: + alpha-blend (using the source alpha channel) the RGB values; + leave destination alpha untouched. [Note: is this correct?] + SDL_SRCCOLORKEY ignored. + SDL_SRCALPHA not set: + copy all of RGBA to the destination. + if SDL_SRCCOLORKEY set, only copy the pixels matching the + RGB values of the source colour key, ignoring alpha in the + comparison. + + RGB->RGB: + SDL_SRCALPHA set: + alpha-blend (using the source per-surface alpha value). + SDL_SRCALPHA not set: + copy RGB. + both: + if SDL_SRCCOLORKEY set, only copy the pixels matching the + source colour key. + + As a special case, blits from surfaces with per-surface alpha + value of 128 (50% transparency) are optimised and much faster + than other alpha values. This does not apply to surfaces with + alpha channels (per-pixel alpha). + + New functions for manipulating the gamma of the display have + been added: + int SDL_SetGamma(float red, float green, float blue); + int SDL_SetGammaRamp(Uint8 *red, Uint8 *green, Uint8 *blue); + int SDL_GetGammaRamp(Uint8 *red, Uint8 *green, Uint8 *blue); + Gamma ramps are tables with 256 entries which map the screen color + components into actually displayed colors. For an example of + implementing gamma correction and gamma fades, see test/testgamma.c + Gamma control is not supported on all hardware. + +1.1.4: + The size of the SDL_CDtrack structure changed from 8 to 12 bytes + as the size of the length member was extended to 32 bits. + + You can now use SDL for 2D blitting with a GL mode by passing the + SDL_OPENGLBLIT flag to SDL_SetVideoMode(). You can specify 16 or + 32 bpp, and the data in the framebuffer is put into the GL scene + when you call SDL_UpdateRects(), and the scene will be visible + when you call SDL_GL_SwapBuffers(). + + Run the "testgl" test program with the -logo command line option + to see an example of this blending of 2D and 3D in SDL. + +1.1.3: + Added SDL_FreeRW() to the API, to complement SDL_AllocRW() + + Added resizable window support - just add SDL_RESIZABLE to the + SDL_SetVideoMode() flags, and then wait for SDL_VIDEORESIZE events. + See SDL_events.h for details on the new SDL_ResizeEvent structure. + + Added condition variable support, based on mutexes and semaphores. + SDL_CreateCond() + SDL_DestroyCond() + SDL_CondSignal() + SDL_CondBroadcast() + SDL_CondWait() + SDL_CondTimedWait() + The new function prototypes are in SDL_mutex.h + + Added counting semaphore support, based on the mutex primitive. + SDL_CreateSemaphore() + SDL_DestroySemaphore() + SDL_SemWait() + SDL_SemTryWait() + SDL_SemWaitTimeout() + SDL_SemPost() + SDL_SemValue() + The new function prototypes are in SDL_mutex.h + + Added support for asynchronous blitting. To take advantage of this, + you must set the SDL_ASYNCBLIT flag when setting the video mode and + creating surfaces that you want accelerated in this way. You must + lock surfaces that have this flag set, and the lock will block until + any queued blits have completed. + + Added YUV video overlay support. + The supported YUV formats are: YV12, IYUV, YUY2, UYVY, and YVYU. + This function creates an overlay surface: + SDL_CreateYUVOverlay() + You must lock and unlock the overlay to get access to the data: + SDL_LockYUVOverlay() SDL_UnlockYUVOverlay() + You can then display the overlay: + SDL_DisplayYUVOverlay() + You must free the overlay when you are done using it: + SDL_FreeYUVOverlay() + See SDL_video.h for the full function prototypes. + + The joystick hat position constants have been changed: + Old constant New constant + ------------ ------------ + 0 SDL_HAT_CENTERED + 1 SDL_HAT_UP + 2 SDL_HAT_RIGHTUP + 3 SDL_HAT_RIGHT + 4 SDL_HAT_RIGHTDOWN + 5 SDL_HAT_DOWN + 6 SDL_HAT_LEFTDOWN + 7 SDL_HAT_LEFT + 8 SDL_HAT_LEFTUP + The new constants are bitmasks, so you can check for the + individual axes like this: + if ( hat_position & SDL_HAT_UP ) { + } + and you'll catch left-up, up, and right-up. + +1.1.2: + Added multiple timer support: + SDL_AddTimer() and SDL_RemoveTimer() + + SDL_WM_SetIcon() now respects the icon colorkey if mask is NULL. + +1.1.0: + Added initial OpenGL support. + First set GL attributes (such as RGB depth, alpha depth, etc.) + SDL_GL_SetAttribute() + Then call SDL_SetVideoMode() with the SDL_OPENGL flag. + Perform all of your normal GL drawing. + Finally swap the buffers with the new SDL function: + SDL_GL_SwapBuffers() + See the new 'testgl' test program for an example of using GL with SDL. + + You can load GL extension functions by using the function: + SDL_GL_LoadProcAddress() + + Added functions to initialize and cleanup specific SDL subsystems: + SDL_InitSubSystem() and SDL_QuitSubSystem() + + Added user-defined event type: + typedef struct { + Uint8 type; + int code; + void *data1; + void *data2; + } SDL_UserEvent; + This structure is in the "user" member of an SDL_Event. + + Added a function to push events into the event queue: + SDL_PushEvent() + + Example of using the new SDL user-defined events: + { + SDL_Event event; + + event.type = SDL_USEREVENT; + event.user.code = my_event_code; + event.user.data1 = significant_data; + event.user.data2 = 0; + SDL_PushEvent(&event); + } + + Added a function to get mouse deltas since last query: + SDL_GetRelativeMouseState() + + Added a boolean datatype to SDL_types.h: + SDL_bool = { SDL_TRUE, SDL_FALSE } + + Added a function to get the current audio status: + SDL_GetAudioState(); + It returns one of: + SDL_AUDIO_STOPPED, + SDL_AUDIO_PLAYING, + SDL_AUDIO_PAUSED + + Added an AAlib driver (ASCII Art) - by Stephane Peter. + +1.0.6: + The input grab state is reset after each call to SDL_SetVideoMode(). + The input is grabbed by default in fullscreen mode, and ungrabbed in + windowed mode. If you want to set input grab to a particular value, + you should set it after each call to SDL_SetVideoMode(). + +1.0.5: + Exposed SDL_AudioInit(), SDL_VideoInit() + Added SDL_AudioDriverName() and SDL_VideoDriverName() + + Added new window manager function: + SDL_WM_ToggleFullScreen() + This is currently implemented only on Linux + + The ALT-ENTER code has been removed - it's not appropriate for a + lib to bind keys when they aren't even emergency escape sequences. + + ALT-ENTER functionality can be implemented with the following code: + + int Handle_AltEnter(const SDL_Event *event) + { + if ( event->type == SDL_KEYDOWN ) { + if ( (event->key.keysym.sym == SDLK_RETURN) && + (event->key.keysym.mod & KMOD_ALT) ) { + SDL_WM_ToggleFullScreen(SDL_GetVideoSurface()); + return(0); + } + } + return(1); + } + SDL_SetEventFilter(Handle_AltEnter); + +1.0.3: + Under X11, if you grab the input and hide the mouse cursor, + the mouse will go into a "relative motion" mode where you + will always get relative motion events no matter how far in + each direction you move the mouse - relative motion is not + bounded by the edges of the window (though the absolute values + of the mouse positions are clamped by the size of the window). + The SVGAlib, framebuffer console, and DirectInput drivers all + have this behavior naturally, and the GDI and BWindow drivers + never go into "relative motion" mode. + +1.0.2: + Added a function to enable keyboard repeat: + SDL_EnableKeyRepeat() + + Added a function to grab the mouse and keyboard input + SDL_WM_GrabInput() + + Added a function to iconify the window. + SDL_WM_IconifyWindow() + If this function succeeds, the application will receive an event + signaling SDL_APPACTIVE event + +1.0.1: + Added constants to SDL_audio.h for 16-bit native byte ordering: + AUDIO_U16SYS, AUDIO_S16SYS + +1.0.0: + New public release + +Version 0.11: + +0.11.5: + A new function SDL_GetVideoSurface() has been added, and returns + a pointer to the current display surface. + + SDL_AllocSurface() has been renamed SDL_CreateRGBSurface(), and + a new function SDL_CreateRGBSurfaceFrom() has been added to allow + creating an SDL surface from an existing pixel data buffer. + + Added SDL_GetRGB() to the headers and documentation. + +0.11.4: + SDL_SetLibraryPath() is no longer meaningful, and has been removed. + +0.11.3: + A new flag for SDL_Init(), SDL_INIT_NOPARACHUTE, prevents SDL from + installing fatal signal handlers on operating systems that support + them. + +Version 0.9: + +0.9.15: + SDL_CreateColorCursor() has been removed. Color cursors should + be implemented as sprites, blitted by the application when the + cursor moves. To get smooth color cursor updates when the app + is busy, pass the SDL_INIT_EVENTTHREAD flag to SDL_Init(). This + allows you to handle the mouse motion in another thread from an + event filter function, but is currently only supported by Linux + and BeOS. Note that you'll have to protect the display surface + from multi-threaded access by using mutexes if you do this. + + Thread-safe surface support has been removed from SDL. + This makes blitting somewhat faster, by removing SDL_MiddleBlit(). + Code that used SDL_MiddleBlit() should use SDL_LowerBlit() instead. + You can make your surfaces thread-safe by allocating your own + mutex and making lock/unlock calls around accesses to your surface. + +0.9.14: + SDL_GetMouseState() now takes pointers to int rather than Uint16. + + If you set the SDL_WINDOWID environment variable under UNIX X11, + SDL will use that as the main window instead of creating it's own. + This is an unsupported extension to SDL, and not portable at all. + +0.9.13: + Added a function SDL_SetLibraryPath() which can be used to specify + the directory containing the SDL dynamic libraries. This is useful + for commercial applications which ship with particular versions + of the libraries, and for security on multi-user systems. + If this function is not used, the default system directories are + searched using the native dynamic object loading mechanism. + + In order to support C linkage under Visual C++, you must declare + main() without any return type: + main(int argc, char *argv[]) { + /* Do the program... */ + return(0); + } + C++ programs should also return a value if compiled under VC++. + + The blit_endian member of the SDL_VideoInfo struct has been removed. + + SDL_SymToASCII() has been replaced with SDL_GetKeyName(), so there + is now no longer any function to translate a keysym to a character. + + The SDL_keysym structure has been extended with a 'scancode' and + 'unicode' member. The 'scancode' is a hardware specific scancode + for the key that was pressed, and may be 0. The 'unicode' member + is a 16-bit UNICODE translation of the key that was pressed along + with any modifiers or compose keys that have been pressed. + If no UNICODE translation exists for the key, 'unicode' will be 0. + + Added a function SDL_EnableUNICODE() to enable/disable UNICODE + translation of character keypresses. Translation defaults off. + + To convert existing code to use the new API, change code which + uses SDL_SymToASCII() to get the keyname to use SDL_GetKeyName(), + and change code which uses it to get the ASCII value of a sym to + use the 'unicode' member of the event keysym. + +0.9.12: + There is partial support for 64-bit datatypes. I don't recommend + you use this if you have a choice, because 64-bit datatypes are not + supported on many platforms. On platforms for which it is supported, + the SDL_HAS_64BIT_TYPE C preprocessor define will be enabled, and + you can use the Uint64 and Sint64 datatypes. + + Added functions to SDL_endian.h to support 64-bit datatypes: + SDL_SwapLE64(), SDL_SwapBE64(), + SDL_ReadLE64(), SDL_ReadBE64(), SDL_WriteLE64(), SDL_WriteBE64() + + A new member "len_ratio" has been added to the SDL_AudioCVT structure, + and allows you to determine either the original buffer length or the + converted buffer length, given the other. + + A new function SDL_FreeWAV() has been added to the API to free data + allocated by SDL_LoadWAV_RW(). This is necessary under Win32 since + the gcc compiled DLL uses a different heap than VC++ compiled apps. + + SDL now has initial support for international keyboards using the + Latin character set. + If a particular mapping is desired, you can set the DEFAULT_KEYBOARD + compile-time variable, or you can set the environment variable + "SDL_KEYBOARD" to a string identifying the keyboard mapping you desire. + The valid values for these variables can be found in SDL_keyboard.c + + Full support for German and French keyboards under X11 is implemented. + +0.9.11: + The THREADED_EVENTS compile-time define has been replaced with the + SDL_INIT_EVENTTHREAD flag. If this flag is passed to SDL_Init(), + SDL will create a separate thread to perform input event handling. + If this flag is passed to SDL_Init(), and the OS doesn't support + event handling in a separate thread, SDL_Init() will fail. + Be sure to add calls to SDL_Delay() in your main thread to allow + the OS to schedule your event thread, or it may starve, leading + to slow event delivery and/or dropped events. + Currently MacOS and Win32 do not support this flag, while BeOS + and Linux do support it. I recommend that your application only + use this flag if absolutely necessary. + + The SDL thread function passed to SDL_CreateThread() now returns a + status. This status can be retrieved by passing a non-NULL pointer + as the 'status' argument to SDL_WaitThread(). + + The volume parameter to SDL_MixAudio() has been increased in range + from (0-8) to (0-128) + + SDL now has a data source abstraction which can encompass a file, + an area of memory, or any custom object you can envision. It uses + these abstractions, SDL_RWops, in the endian read/write functions, + and the built-in WAV and BMP file loaders. This means you can load + WAV chunks from memory mapped files, compressed archives, network + pipes, or anything else that has a data read abstraction. + + There are three built-in data source abstractions: + SDL_RWFromFile(), SDL_RWFromFP(), SDL_RWFromMem() + along with a generic data source allocation function: + SDL_AllocRW() + These data sources can be used like stdio file pointers with the + following convenience functions: + SDL_RWseek(), SDL_RWread(), SDL_RWwrite(), SDL_RWclose() + These functions are defined in the new header file "SDL_rwops.h" + + The endian swapping functions have been turned into macros for speed + and SDL_CalculateEndian() has been removed. SDL_endian.h now defines + SDL_BYTEORDER as either SDL_BIG_ENDIAN or SDL_LIL_ENDIAN depending on + the endianness of the host system. + + The endian read/write functions now take an SDL_RWops pointer + instead of a stdio FILE pointer, to support the new data source + abstraction. + + The SDL_*LoadWAV() functions have been replaced with a single + SDL_LoadWAV_RW() function that takes a SDL_RWops pointer as it's + first parameter, and a flag whether or not to automatically + free it as the second parameter. SDL_LoadWAV() is a macro for + backward compatibility and convenience: + SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); + + The SDL_*LoadBMP()/SDL_*SaveBMP() functions have each been replaced + with a single function that takes a SDL_RWops pointer as it's + first parameter, and a flag whether or not to automatically + free it as the second parameter. SDL_LoadBMP() and SDL_SaveBMP() + are macros for backward compatibility and convenience: + SDL_LoadBMP_RW(SDL_RWFromFile("sample.bmp", "rb"), 1, ...); + SDL_SaveBMP_RW(SDL_RWFromFile("sample.bmp", "wb"), 1, ...); + Note that these functions use SDL_RWseek() extensively, and should + not be used on pipes or other non-seekable data sources. + +0.9.10: + The Linux SDL_SysWMInfo and SDL_SysWMMsg structures have been + extended to support multiple types of display drivers, as well as + safe access to the X11 display when THREADED_EVENTS is enabled. + The new structures are documented in the SDL_syswm.h header file. + + Thanks to John Elliott , the UK keyboard + should now work properly, as well as the "Windows" keys on US + keyboards. + + The Linux CD-ROM code now reads the CD-ROM devices from /etc/fstab + instead of trying to open each block device on the system. + The CD must be listed in /etc/fstab as using the iso9660 filesystem. + + On Linux, if you define THREADED_EVENTS at compile time, a separate + thread will be spawned to gather X events asynchronously from the + graphics updates. This hasn't been extensively tested, but it does + provide a means of handling keyboard and mouse input in a separate + thread from the graphics thread. (This is now enabled by default.) + + A special access function SDL_PeepEvents() allows you to manipulate + the event queue in a thread-safe manner, including peeking at events, + removing events of a specified type, and adding new events of arbitrary + type to the queue (use the new 'user' member of the SDL_Event type). + + If you use SDL_PeepEvents() to gather events, then the main graphics + thread needs to call SDL_PumpEvents() periodically to drive the event + loop and generate input events. This is not necessary if SDL has been + compiled with THREADED_EVENTS defined, but doesn't hurt. + + A new function SDL_ThreadID() returns the identifier associated with + the current thread. + +0.9.9: + The AUDIO_STEREO format flag has been replaced with a new 'channels' + member of the SDL_AudioSpec structure. The channels are 1 for mono + audio, and 2 for stereo audio. In the future more channels may be + supported for 3D surround sound. + + The SDL_MixAudio() function now takes an additional volume parameter, + which should be set to SDL_MIX_MAXVOLUME for compatibility with the + original function. + + The CD-ROM functions which take a 'cdrom' parameter can now be + passed NULL, and will act on the last successfully opened CD-ROM. + +0.9.8: + No changes, bugfixes only. + +0.9.7: + No changes, bugfixes only. + +0.9.6: + Added a fast rectangle fill function: SDL_FillRect() + + Addition of a useful function for getting info on the video hardware: + const SDL_VideoInfo *SDL_GetVideoInfo(void) + This function replaces SDL_GetDisplayFormat(). + + Initial support for double-buffering: + Use the SDL_DOUBLEBUF flag in SDL_SetVideoMode() + Update the screen with a new function: SDL_Flip() + + SDL_AllocSurface() takes two new flags: + SDL_SRCCOLORKEY means that the surface will be used for colorkey blits + and if the hardware supports hardware acceleration of colorkey blits + between two surfaces in video memory, to place the surface in video + memory if possible, otherwise it will be placed in system memory. + SDL_SRCALPHA means that the surface will be used for alpha blits and + if the hardware supports hardware acceleration of alpha blits between + two surfaces in video memory, to place the surface in video memory + if possible, otherwise it will be placed in system memory. + SDL_HWSURFACE now means that the surface will be created with the + same format as the display surface, since having surfaces in video + memory is only useful for fast blitting to the screen, and you can't + blit surfaces with different surface formats in video memory. + +0.9.5: + You can now pass a NULL mask to SDL_WM_SetIcon(), and it will assume + that the icon consists of the entire image. + + SDL_LowerBlit() is back -- but don't use it on the display surface. + It is exactly the same as SDL_MiddleBlit(), but doesn't check for + thread safety. + + Added SDL_FPLoadBMP(), SDL_FPSaveBMP(), SDL_FPLoadWAV(), which take + a FILE pointer instead of a file name. + + Added CD-ROM audio control API: + SDL_CDNumDrives() + SDL_CDName() + SDL_CDOpen() + SDL_CDStatus() + SDL_CDPlayTracks() + SDL_CDPlay() + SDL_CDPause() + SDL_CDResume() + SDL_CDStop() + SDL_CDEject() + SDL_CDClose() + +0.9.4: + No changes, bugfixes only. + +0.9.3: + Mouse motion event now includes relative motion information: + Sint16 event->motion.xrel, Sint16 event->motion.yrel + + X11 keyrepeat handling can be disabled by defining IGNORE_X_KEYREPEAT + (Add -DIGNORE_X_KEYREPEAT to CFLAGS line in obj/x11Makefile) + +0.9.2: + No changes, bugfixes only. + +0.9.1: + Removed SDL_MapSurface() and SDL_UnmapSurface() -- surfaces are now + automatically mapped on blit. + +0.8.0: + SDL stable release diff --git a/Xcode.tar.gz b/Xcode.tar.gz new file mode 100644 index 0000000..b18e74e Binary files /dev/null and b/Xcode.tar.gz differ diff --git a/acinclude/alsa.m4 b/acinclude/alsa.m4 new file mode 100644 index 0000000..d818e70 --- /dev/null +++ b/acinclude/alsa.m4 @@ -0,0 +1,145 @@ +############################################################################## +dnl Configure Paths for Alsa +dnl Some modifications by Richard Boulton +dnl Christopher Lansdown +dnl Jaroslav Kysela +dnl Last modification: alsa.m4,v 1.23 2004/01/16 18:14:22 tiwai Exp +dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate. +dnl enables arguments --with-alsa-prefix= +dnl --with-alsa-enc-prefix= +dnl --disable-alsatest +dnl +dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified, +dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result. +dnl +AC_DEFUN([AM_PATH_ALSA], +[dnl Save the original CFLAGS, LDFLAGS, and LIBS +alsa_save_CFLAGS="$CFLAGS" +alsa_save_LDFLAGS="$LDFLAGS" +alsa_save_LIBS="$LIBS" +alsa_found=yes + +dnl +dnl Get the cflags and libraries for alsa +dnl +AC_ARG_WITH(alsa-prefix, +[ --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional)], +[alsa_prefix="$withval"], [alsa_prefix=""]) + +AC_ARG_WITH(alsa-inc-prefix, +[ --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional)], +[alsa_inc_prefix="$withval"], [alsa_inc_prefix=""]) + +dnl FIXME: this is not yet implemented +AC_ARG_ENABLE(alsatest, +[ --disable-alsatest Do not try to compile and run a test Alsa program], +[enable_alsatest="$enableval"], +[enable_alsatest=yes]) + +dnl Add any special include directories +AC_MSG_CHECKING(for ALSA CFLAGS) +if test "$alsa_inc_prefix" != "" ; then + ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix" + CFLAGS="$CFLAGS -I$alsa_inc_prefix" +fi +AC_MSG_RESULT($ALSA_CFLAGS) + +dnl add any special lib dirs +AC_MSG_CHECKING(for ALSA LDFLAGS) +if test "$alsa_prefix" != "" ; then + ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix" + LDFLAGS="$LDFLAGS $ALSA_LIBS" +fi + +dnl add the alsa library +ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread" +LIBS=`echo $LIBS | sed 's/-lm//'` +LIBS=`echo $LIBS | sed 's/-ldl//'` +LIBS=`echo $LIBS | sed 's/-lpthread//'` +LIBS=`echo $LIBS | sed 's/ //'` +LIBS="$ALSA_LIBS $LIBS" +AC_MSG_RESULT($ALSA_LIBS) + +dnl Check for a working version of libasound that is of the right version. +min_alsa_version=ifelse([$1], ,0.1.1,$1) +AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version) +no_alsa="" + alsa_min_major_version=`echo $min_alsa_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + alsa_min_minor_version=`echo $min_alsa_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + alsa_min_micro_version=`echo $min_alsa_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + +AC_LANG_SAVE +AC_LANG_C +AC_TRY_COMPILE([ +#include +], [ +/* ensure backward compatibility */ +#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR) +#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR +#endif +#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR) +#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR +#endif +#if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR) +#define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR +#endif + +# if(SND_LIB_MAJOR > $alsa_min_major_version) + exit(0); +# else +# if(SND_LIB_MAJOR < $alsa_min_major_version) +# error not present +# endif + +# if(SND_LIB_MINOR > $alsa_min_minor_version) + exit(0); +# else +# if(SND_LIB_MINOR < $alsa_min_minor_version) +# error not present +# endif + +# if(SND_LIB_SUBMINOR < $alsa_min_micro_version) +# error not present +# endif +# endif +# endif +exit(0); +], + [AC_MSG_RESULT(found.)], + [AC_MSG_RESULT(not present.) + ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)]) + alsa_found=no] +) +AC_LANG_RESTORE + +dnl Now that we know that we have the right version, let's see if we have the library and not just the headers. +if test "x$enable_alsatest" = "xyes"; then +AC_CHECK_LIB([asound], [snd_ctl_open],, + [ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)]) + alsa_found=no] +) +fi + +if test "x$alsa_found" = "xyes" ; then + ifelse([$2], , :, [$2]) + LIBS=`echo $LIBS | sed 's/-lasound//g'` + LIBS=`echo $LIBS | sed 's/ //'` + LIBS="-lasound $LIBS" +fi +if test "x$alsa_found" = "xno" ; then + ifelse([$3], , :, [$3]) + CFLAGS="$alsa_save_CFLAGS" + LDFLAGS="$alsa_save_LDFLAGS" + LIBS="$alsa_save_LIBS" + ALSA_CFLAGS="" + ALSA_LIBS="" +fi + +dnl That should be it. Now just export out symbols: +AC_SUBST(ALSA_CFLAGS) +AC_SUBST(ALSA_LIBS) +]) diff --git a/acinclude/esd.m4 b/acinclude/esd.m4 new file mode 100644 index 0000000..58d64a9 --- /dev/null +++ b/acinclude/esd.m4 @@ -0,0 +1,168 @@ +############################################################################## +# +# --- esd.m4 --- +# +# Configure paths for ESD +# Manish Singh 98-9-30 +# stolen back from Frank Belew +# stolen from Manish Singh +# Shamelessly stolen from Owen Taylor + +dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS +dnl +AC_DEFUN([AM_PATH_ESD], +[dnl +dnl Get the cflags and libraries from the esd-config script +dnl +AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)], + esd_prefix="$withval", esd_prefix="") +AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)], + esd_exec_prefix="$withval", esd_exec_prefix="") +AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program], + , enable_esdtest=yes) + + if test x$esd_exec_prefix != x ; then + esd_args="$esd_args --exec-prefix=$esd_exec_prefix" + if test x${ESD_CONFIG+set} != xset ; then + ESD_CONFIG=$esd_exec_prefix/bin/esd-config + fi + fi + if test x$esd_prefix != x ; then + esd_args="$esd_args --prefix=$esd_prefix" + if test x${ESD_CONFIG+set} != xset ; then + ESD_CONFIG=$esd_prefix/bin/esd-config + fi + fi + + AC_PATH_PROG(ESD_CONFIG, esd-config, no) + min_esd_version=ifelse([$1], ,0.2.7,$1) + AC_MSG_CHECKING(for ESD - version >= $min_esd_version) + no_esd="" + if test "$ESD_CONFIG" = "no" ; then + no_esd=yes + else + ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags` + ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs` + + esd_major_version=`$ESD_CONFIG $esd_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + esd_minor_version=`$ESD_CONFIG $esd_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_esdtest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $ESD_CFLAGS" + LIBS="$LIBS $ESD_LIBS" +dnl +dnl Now check if the installed ESD is sufficiently new. (Also sanity +dnl checks the results of esd-config to some extent +dnl + rm -f conf.esdtest + AC_TRY_RUN([ +#include +#include +#include +#include + +char* +my_strdup (char *str) +{ + char *new_str; + + if (str) + { + new_str = malloc ((strlen (str) + 1) * sizeof(char)); + strcpy (new_str, str); + } + else + new_str = NULL; + + return new_str; +} + +int main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.esdtest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = my_strdup("$min_esd_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_esd_version"); + exit(1); + } + + if (($esd_major_version > major) || + (($esd_major_version == major) && ($esd_minor_version > minor)) || + (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version); + printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro); + printf("*** best to upgrade to the required version.\n"); + printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n"); + printf("*** to point to the correct copy of esd-config, and remove the file\n"); + printf("*** config.cache before re-running configure\n"); + return 1; + } +} + +],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_esd" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$ESD_CONFIG" = "no" ; then + echo "*** The esd-config script installed by ESD could not be found" + echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the ESD_CONFIG environment variable to the" + echo "*** full path to esd-config." + else + if test -f conf.esdtest ; then + : + else + echo "*** Could not run ESD test program, checking why..." + CFLAGS="$CFLAGS $ESD_CFLAGS" + LIBS="$LIBS $ESD_LIBS" + AC_TRY_LINK([ +#include +#include +], [ return 0; ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding ESD or finding the wrong" + echo "*** version of ESD. If it is not finding ESD, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means ESD was incorrectly installed" + echo "*** or that you have moved ESD since it was installed. In the latter case, you" + echo "*** may want to edit the esd-config script: $ESD_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + ESD_CFLAGS="" + ESD_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(ESD_CFLAGS) + AC_SUBST(ESD_LIBS) + rm -f conf.esdtest +]) diff --git a/acinclude/libtool.m4 b/acinclude/libtool.m4 new file mode 100644 index 0000000..6894db8 --- /dev/null +++ b/acinclude/libtool.m4 @@ -0,0 +1,7370 @@ +############################################################################## +# Based on libtool-2.2.6a +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 56 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl +_LT_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\[$]0 --fallback-echo"')dnl " + lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` + ;; +esac + +_LT_OUTPUT_LIBTOOL_INIT +]) + + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +cat >"$CONFIG_LT" <<_LTEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate a libtool stub with the current configuration. + +lt_cl_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AS_SHELL_SANITIZE +_AS_PREPARE + +exec AS_MESSAGE_FD>&1 +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2008 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +if test "$no_create" != yes; then + lt_cl_success=: + test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" + exec AS_MESSAGE_LOG_FD>/dev/null + $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false + exec AS_MESSAGE_LOG_FD>>config.log + $lt_cl_success || AS_EXIT(1) +fi +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_XSI_SHELLFNS + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES +# -------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=echo + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX +# ----------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_SHELL_INIT + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[_LT_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +[$]* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(lt_ECHO) +]) +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], + [An echo program that does not interpret backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[AC_CHECK_TOOL(AR, ar, false) +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1]) + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + beos*) + # On BeOS, this test takes a really really long time. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line __oline__ "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[[4-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + #soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + soname_spec='`echo ${libname} | sed -e 's/^lib//'`${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + #soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + soname_spec='`echo ${libname} | $SED -e 's/^lib//'`${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[[3-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + lt_cv_deplibs_check_method=pass_all + ;; + +cegcc) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method == "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC*) + # IBM XL 8.0 on PPC + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac +AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE(int foo(void) {}, + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + ) + LDFLAGS="$save_LDFLAGS" + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], + [[If ld is used when linking, flag to hardcode $libdir into a binary + during linking. This must work even if $libdir does not exist]]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting ${shlibpath_var} if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [fix_srcfile_path], [1], + [Fix the shell variable $srcfile for the compiler]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report which library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_PROG_CXX +# ------------ +# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ +# compiler, we have our own version here. +m4_defun([_LT_PROG_CXX], +[ +pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) +AC_PROG_CXX +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_CXX + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_CXX], []) + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[AC_REQUIRE([_LT_PROG_CXX])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + gnu*) + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 will use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + xl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=echo + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +]) +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_PROG_F77 +# ------------ +# Since AC_PROG_F77 is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_F77], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) +AC_PROG_F77 +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_F77 + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_F77], []) + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_REQUIRE([_LT_PROG_F77])dnl +AC_LANG_PUSH(Fortran 77) + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + CC=${F77-"f77"} + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_PROG_FC +# ----------- +# Since AC_PROG_FC is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_FC], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) +AC_PROG_FC +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_FC + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_FC], []) + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_REQUIRE([_LT_PROG_FC])dnl +AC_LANG_PUSH(Fortran) + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + CC=${FC-"f95"} + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC="$lt_save_CC" +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC="$lt_save_CC" +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_XSI_SHELLFNS +# --------------------- +# Bourne and XSI compatible variants of some useful shell functions. +m4_defun([_LT_PROG_XSI_SHELLFNS], +[case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $[*] )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + +dnl func_dirname_and_basename +dnl A portable version of this function is already defined in general.m4sh +dnl so there is no need for it here. + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[[^=]]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$[@]"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]+=\$[2]" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]=\$$[1]\$[2]" +} + +_LT_EOF + ;; + esac +]) + diff --git a/acinclude/ltdl.m4 b/acinclude/ltdl.m4 new file mode 100644 index 0000000..e2b7129 --- /dev/null +++ b/acinclude/ltdl.m4 @@ -0,0 +1,806 @@ +############################################################################## +# ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*- +# +# Copyright (C) 1999-2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Thomas Tanner, 1999 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 17 LTDL_INIT + +# LT_CONFIG_LTDL_DIR(DIRECTORY, [LTDL-MODE]) +# ------------------------------------------ +# DIRECTORY contains the libltdl sources. It is okay to call this +# function multiple times, as long as the same DIRECTORY is always given. +AC_DEFUN([LT_CONFIG_LTDL_DIR], +[AC_BEFORE([$0], [LTDL_INIT]) +_$0($*) +])# LT_CONFIG_LTDL_DIR + +# We break this out into a separate macro, so that we can call it safely +# internally without being caught accidentally by the sed scan in libtoolize. +m4_defun([_LT_CONFIG_LTDL_DIR], +[dnl remove trailing slashes +m4_pushdef([_ARG_DIR], m4_bpatsubst([$1], [/*$])) +m4_case(_LTDL_DIR, + [], [dnl only set lt_ltdl_dir if _ARG_DIR is not simply `.' + m4_if(_ARG_DIR, [.], + [], + [m4_define([_LTDL_DIR], _ARG_DIR) + _LT_SHELL_INIT([lt_ltdl_dir=']_ARG_DIR['])])], + [m4_if(_ARG_DIR, _LTDL_DIR, + [], + [m4_fatal([multiple libltdl directories: `]_LTDL_DIR[', `]_ARG_DIR['])])]) +m4_popdef([_ARG_DIR]) +])# _LT_CONFIG_LTDL_DIR + +# Initialise: +m4_define([_LTDL_DIR], []) + + +# _LT_BUILD_PREFIX +# ---------------- +# If Autoconf is new enough, expand to `${top_build_prefix}', otherwise +# to `${top_builddir}/'. +m4_define([_LT_BUILD_PREFIX], +[m4_ifdef([AC_AUTOCONF_VERSION], + [m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.62]), + [-1], [m4_ifdef([_AC_HAVE_TOP_BUILD_PREFIX], + [${top_build_prefix}], + [${top_builddir}/])], + [${top_build_prefix}])], + [${top_builddir}/])[]dnl +]) + + +# LTDL_CONVENIENCE +# ---------------- +# sets LIBLTDL to the link flags for the libltdl convenience library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-convenience to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. LIBLTDL will be prefixed with +# '${top_build_prefix}' if available, otherwise with '${top_builddir}/', +# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single +# quotes!). If your package is not flat and you're not using automake, +# define top_build_prefix, top_builddir, and top_srcdir appropriately +# in your Makefiles. +AC_DEFUN([LTDL_CONVENIENCE], +[AC_BEFORE([$0], [LTDL_INIT])dnl +dnl Although the argument is deprecated and no longer documented, +dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one +dnl here make sure it is the same as any other declaration of libltdl's +dnl location! This also ensures lt_ltdl_dir is set when configure.ac is +dnl not yet using an explicit LT_CONFIG_LTDL_DIR. +m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl +_$0() +])# LTDL_CONVENIENCE + +# AC_LIBLTDL_CONVENIENCE accepted a directory argument in older libtools, +# now we have LT_CONFIG_LTDL_DIR: +AU_DEFUN([AC_LIBLTDL_CONVENIENCE], +[_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) +_LTDL_CONVENIENCE]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBLTDL_CONVENIENCE], []) + + +# _LTDL_CONVENIENCE +# ----------------- +# Code shared by LTDL_CONVENIENCE and LTDL_INIT([convenience]). +m4_defun([_LTDL_CONVENIENCE], +[case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; +esac +LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la" +LTDLDEPS=$LIBLTDL +LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}" + +AC_SUBST([LIBLTDL]) +AC_SUBST([LTDLDEPS]) +AC_SUBST([LTDLINCL]) + +# For backwards non-gettext consistent compatibility... +INCLTDL="$LTDLINCL" +AC_SUBST([INCLTDL]) +])# _LTDL_CONVENIENCE + + +# LTDL_INSTALLABLE +# ---------------- +# sets LIBLTDL to the link flags for the libltdl installable library +# and LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-install to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called from here. If an installed libltdl +# is not found, LIBLTDL will be prefixed with '${top_build_prefix}' if +# available, otherwise with '${top_builddir}/', and LTDLINCL will be +# prefixed with '${top_srcdir}/' (note the single quotes!). If your +# package is not flat and you're not using automake, define top_build_prefix, +# top_builddir, and top_srcdir appropriately in your Makefiles. +# In the future, this macro may have to be called after LT_INIT. +AC_DEFUN([LTDL_INSTALLABLE], +[AC_BEFORE([$0], [LTDL_INIT])dnl +dnl Although the argument is deprecated and no longer documented, +dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one +dnl here make sure it is the same as any other declaration of libltdl's +dnl location! This also ensures lt_ltdl_dir is set when configure.ac is +dnl not yet using an explicit LT_CONFIG_LTDL_DIR. +m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl +_$0() +])# LTDL_INSTALLABLE + +# AC_LIBLTDL_INSTALLABLE accepted a directory argument in older libtools, +# now we have LT_CONFIG_LTDL_DIR: +AU_DEFUN([AC_LIBLTDL_INSTALLABLE], +[_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) +_LTDL_INSTALLABLE]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBLTDL_INSTALLABLE], []) + + +# _LTDL_INSTALLABLE +# ----------------- +# Code shared by LTDL_INSTALLABLE and LTDL_INIT([installable]). +m4_defun([_LTDL_INSTALLABLE], +[if test -f $prefix/lib/libltdl.la; then + lt_save_LDFLAGS="$LDFLAGS" + LDFLAGS="-L$prefix/lib $LDFLAGS" + AC_CHECK_LIB([ltdl], [lt_dlinit], [lt_lib_ltdl=yes]) + LDFLAGS="$lt_save_LDFLAGS" + if test x"${lt_lib_ltdl-no}" = xyes; then + if test x"$enable_ltdl_install" != xyes; then + # Don't overwrite $prefix/lib/libltdl.la without --enable-ltdl-install + AC_MSG_WARN([not overwriting libltdl at $prefix, force with `--enable-ltdl-install']) + enable_ltdl_install=no + fi + elif test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + fi +fi + +# If configure.ac declared an installable ltdl, and the user didn't override +# with --disable-ltdl-install, we will install the shipped libltdl. +case $enable_ltdl_install in + no) ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLDEPS= + LTDLINCL= + ;; + *) enable_ltdl_install=yes + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdl.la" + LTDLDEPS=$LIBLTDL + LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}" + ;; +esac + +AC_SUBST([LIBLTDL]) +AC_SUBST([LTDLDEPS]) +AC_SUBST([LTDLINCL]) + +# For backwards non-gettext consistent compatibility... +INCLTDL="$LTDLINCL" +AC_SUBST([INCLTDL]) +])# LTDL_INSTALLABLE + + +# _LTDL_MODE_DISPATCH +# ------------------- +m4_define([_LTDL_MODE_DISPATCH], +[dnl If _LTDL_DIR is `.', then we are configuring libltdl itself: +m4_if(_LTDL_DIR, [], + [], + dnl if _LTDL_MODE was not set already, the default value is `subproject': + [m4_case(m4_default(_LTDL_MODE, [subproject]), + [subproject], [AC_CONFIG_SUBDIRS(_LTDL_DIR) + _LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"])], + [nonrecursive], [_LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"; lt_libobj_prefix="$lt_ltdl_dir/"])], + [recursive], [], + [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])dnl +dnl Be careful not to expand twice: +m4_define([$0], []) +])# _LTDL_MODE_DISPATCH + + +# _LT_LIBOBJ(MODULE_NAME) +# ----------------------- +# Like AC_LIBOBJ, except that MODULE_NAME goes into _LT_LIBOBJS instead +# of into LIBOBJS. +AC_DEFUN([_LT_LIBOBJ], [ + m4_pattern_allow([^_LT_LIBOBJS$]) + _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext" +])# _LT_LIBOBJS + + +# LTDL_INIT([OPTIONS]) +# -------------------- +# Clients of libltdl can use this macro to allow the installer to +# choose between a shipped copy of the ltdl sources or a preinstalled +# version of the library. If the shipped ltdl sources are not in a +# subdirectory named libltdl, the directory name must be given by +# LT_CONFIG_LTDL_DIR. +AC_DEFUN([LTDL_INIT], +[dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +dnl We need to keep our own list of libobjs separate from our parent project, +dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while +dnl we look for our own LIBOBJs. +m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ])) +m4_pushdef([AC_LIBSOURCES]) + +dnl If not otherwise defined, default to the 1.5.x compatible subproject mode: +m4_if(_LTDL_MODE, [], + [m4_define([_LTDL_MODE], m4_default([$2], [subproject])) + m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])], + [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])]) + +AC_ARG_WITH([included_ltdl], + [AS_HELP_STRING([--with-included-ltdl], + [use the GNU ltdl sources included here])]) + +if test "x$with_included_ltdl" != xyes; then + # We are not being forced to use the included libltdl sources, so + # decide whether there is a useful installed version we can use. + AC_CHECK_HEADER([ltdl.h], + [AC_CHECK_DECL([lt_dlinterface_register], + [AC_CHECK_LIB([ltdl], [lt_dladvise_preload], + [with_included_ltdl=no], + [with_included_ltdl=yes])], + [with_included_ltdl=yes], + [AC_INCLUDES_DEFAULT + #include ])], + [with_included_ltdl=yes], + [AC_INCLUDES_DEFAULT] + ) +fi + +dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE +dnl was called yet, then for old times' sake, we assume libltdl is in an +dnl eponymous directory: +AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])]) + +AC_ARG_WITH([ltdl_include], + [AS_HELP_STRING([--with-ltdl-include=DIR], + [use the ltdl headers installed in DIR])]) + +if test -n "$with_ltdl_include"; then + if test -f "$with_ltdl_include/ltdl.h"; then : + else + AC_MSG_ERROR([invalid ltdl include directory: `$with_ltdl_include']) + fi +else + with_ltdl_include=no +fi + +AC_ARG_WITH([ltdl_lib], + [AS_HELP_STRING([--with-ltdl-lib=DIR], + [use the libltdl.la installed in DIR])]) + +if test -n "$with_ltdl_lib"; then + if test -f "$with_ltdl_lib/libltdl.la"; then : + else + AC_MSG_ERROR([invalid ltdl library directory: `$with_ltdl_lib']) + fi +else + with_ltdl_lib=no +fi + +case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in + ,yes,no,no,) + m4_case(m4_default(_LTDL_TYPE, [convenience]), + [convenience], [_LTDL_CONVENIENCE], + [installable], [_LTDL_INSTALLABLE], + [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)]) + ;; + ,no,no,no,) + # If the included ltdl is not to be used, then use the + # preinstalled libltdl we found. + AC_DEFINE([HAVE_LTDL], [1], + [Define this if a modern libltdl is already installed]) + LIBLTDL=-lltdl + LTDLDEPS= + LTDLINCL= + ;; + ,no*,no,*) + AC_MSG_ERROR([`--with-ltdl-include' and `--with-ltdl-lib' options must be used together]) + ;; + *) with_included_ltdl=no + LIBLTDL="-L$with_ltdl_lib -lltdl" + LTDLDEPS= + LTDLINCL="-I$with_ltdl_include" + ;; +esac +INCLTDL="$LTDLINCL" + +# Report our decision... +AC_MSG_CHECKING([where to find libltdl headers]) +AC_MSG_RESULT([$LTDLINCL]) +AC_MSG_CHECKING([where to find libltdl library]) +AC_MSG_RESULT([$LIBLTDL]) + +_LTDL_SETUP + +dnl restore autoconf definition. +m4_popdef([AC_LIBOBJ]) +m4_popdef([AC_LIBSOURCES]) + +AC_CONFIG_COMMANDS_PRE([ + _ltdl_libobjs= + _ltdl_ltlibobjs= + if test -n "$_LT_LIBOBJS"; then + # Remove the extension. + _lt_sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do + _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext" + _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo" + done + fi + AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs]) + AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs]) +]) + +# Only expand once: +m4_define([LTDL_INIT]) +])# LTDL_INIT + +# Old names: +AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)]) +AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)]) +AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIB_LTDL], []) +dnl AC_DEFUN([AC_WITH_LTDL], []) +dnl AC_DEFUN([LT_WITH_LTDL], []) + + +# _LTDL_SETUP +# ----------- +# Perform all the checks necessary for compilation of the ltdl objects +# -- including compiler checks and header checks. This is a public +# interface mainly for the benefit of libltdl's own configure.ac, most +# other users should call LTDL_INIT instead. +AC_DEFUN([_LTDL_SETUP], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_SYS_MODULE_EXT])dnl +AC_REQUIRE([LT_SYS_MODULE_PATH])dnl +AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl +AC_REQUIRE([LT_LIB_DLLOAD])dnl +AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl +AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl +AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl +AC_REQUIRE([gl_FUNC_ARGZ])dnl + +m4_require([_LT_CHECK_OBJDIR])dnl +m4_require([_LT_HEADER_DLFCN])dnl +m4_require([_LT_CHECK_DLPREOPEN])dnl +m4_require([_LT_DECL_SED])dnl + +dnl Don't require this, or it will be expanded earlier than the code +dnl that sets the variables it relies on: +_LT_ENABLE_INSTALL + +dnl _LTDL_MODE specific code must be called at least once: +_LTDL_MODE_DISPATCH + +# In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS +# the user used. This is so that ltdl.h can pick up the parent projects +# config.h file, The first file in AC_CONFIG_HEADERS must contain the +# definitions required by ltdl.c. +# FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). +AC_CONFIG_COMMANDS_PRE([dnl +m4_pattern_allow([^LT_CONFIG_H$])dnl +m4_ifset([AH_HEADER], + [LT_CONFIG_H=AH_HEADER], + [m4_ifset([AC_LIST_HEADERS], + [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's,^[[ ]]*,,;s,[[ :]].*$,,'`], + [])])]) +AC_SUBST([LT_CONFIG_H]) + +AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h], + [], [], [AC_INCLUDES_DEFAULT]) + +AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])]) +AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])]) + +AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension]) + +name=ltdl +LTDLOPEN=`eval "\\$ECHO \"$libname_spec\""` +AC_SUBST([LTDLOPEN]) +])# _LTDL_SETUP + + +# _LT_ENABLE_INSTALL +# ------------------ +m4_define([_LT_ENABLE_INSTALL], +[AC_ARG_ENABLE([ltdl-install], + [AS_HELP_STRING([--enable-ltdl-install], [install libltdl])]) + +case ,${enable_ltdl_install},${enable_ltdl_convenience} in + *yes*) ;; + *) enable_ltdl_convenience=yes ;; +esac + +m4_ifdef([AM_CONDITIONAL], +[AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno) + AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)]) +])# _LT_ENABLE_INSTALL + + +# LT_SYS_DLOPEN_DEPLIBS +# --------------------- +AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_CACHE_CHECK([whether deplibs are loaded by dlopen], + [lt_cv_sys_dlopen_deplibs], + [# PORTME does your system automatically load deplibs for dlopen? + # or its logical equivalent (e.g. shl_load for HP-UX < 11) + # For now, we just catch OSes we know something about -- in the + # future, we'll try test this programmatically. + lt_cv_sys_dlopen_deplibs=unknown + case $host_os in + aix3*|aix4.1.*|aix4.2.*) + # Unknown whether this is true for these versions of AIX, but + # we want this `case' here to explicitly catch those versions. + lt_cv_sys_dlopen_deplibs=unknown + ;; + aix[[4-9]]*) + lt_cv_sys_dlopen_deplibs=yes + ;; + amigaos*) + case $host_cpu in + powerpc) + lt_cv_sys_dlopen_deplibs=no + ;; + esac + ;; + darwin*) + # Assuming the user has installed a libdl from somewhere, this is true + # If you are looking for one http://www.opendarwin.org/projects/dlcompat + lt_cv_sys_dlopen_deplibs=yes + ;; + freebsd* | dragonfly*) + lt_cv_sys_dlopen_deplibs=yes + ;; + gnu* | linux* | k*bsd*-gnu) + # GNU and its variants, using gnu ld.so (Glibc) + lt_cv_sys_dlopen_deplibs=yes + ;; + hpux10*|hpux11*) + lt_cv_sys_dlopen_deplibs=yes + ;; + interix*) + lt_cv_sys_dlopen_deplibs=yes + ;; + irix[[12345]]*|irix6.[[01]]*) + # Catch all versions of IRIX before 6.2, and indicate that we don't + # know how it worked for any of those versions. + lt_cv_sys_dlopen_deplibs=unknown + ;; + irix*) + # The case above catches anything before 6.2, and it's known that + # at 6.2 and later dlopen does load deplibs. + lt_cv_sys_dlopen_deplibs=yes + ;; + netbsd*) + lt_cv_sys_dlopen_deplibs=yes + ;; + openbsd*) + lt_cv_sys_dlopen_deplibs=yes + ;; + osf[[1234]]*) + # dlopen did load deplibs (at least at 4.x), but until the 5.x series, + # it did *not* use an RPATH in a shared library to find objects the + # library depends on, so we explicitly say `no'. + lt_cv_sys_dlopen_deplibs=no + ;; + osf5.0|osf5.0a|osf5.1) + # dlopen *does* load deplibs and with the right loader patch applied + # it even uses RPATH in a shared library to search for shared objects + # that the library depends on, but there's no easy way to know if that + # patch is installed. Since this is the case, all we can really + # say is unknown -- it depends on the patch being installed. If + # it is, this changes to `yes'. Without it, it would be `no'. + lt_cv_sys_dlopen_deplibs=unknown + ;; + osf*) + # the two cases above should catch all versions of osf <= 5.1. Read + # the comments above for what we know about them. + # At > 5.1, deplibs are loaded *and* any RPATH in a shared library + # is used to find them so we can finally say `yes'. + lt_cv_sys_dlopen_deplibs=yes + ;; + qnx*) + lt_cv_sys_dlopen_deplibs=yes + ;; + solaris*) + lt_cv_sys_dlopen_deplibs=yes + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + esac + ]) +if test "$lt_cv_sys_dlopen_deplibs" != yes; then + AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1], + [Define if the OS needs help to load dependent libraries for dlopen().]) +fi +])# LT_SYS_DLOPEN_DEPLIBS + +# Old name: +AU_ALIAS([AC_LTDL_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], []) + + +# LT_SYS_MODULE_EXT +# ----------------- +AC_DEFUN([LT_SYS_MODULE_EXT], +[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl +AC_CACHE_CHECK([which extension is used for runtime loadable modules], + [libltdl_cv_shlibext], +[ +module=yes +eval libltdl_cv_shlibext=$shrext_cmds + ]) +if test -n "$libltdl_cv_shlibext"; then + m4_pattern_allow([LT_MODULE_EXT])dnl + AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"], + [Define to the extension used for runtime loadable modules, say, ".so".]) +fi +])# LT_SYS_MODULE_EXT + +# Old name: +AU_ALIAS([AC_LTDL_SHLIBEXT], [LT_SYS_MODULE_EXT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LTDL_SHLIBEXT], []) + + +# LT_SYS_MODULE_PATH +# ------------------ +AC_DEFUN([LT_SYS_MODULE_PATH], +[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl +AC_CACHE_CHECK([which variable specifies run-time module search path], + [lt_cv_module_path_var], [lt_cv_module_path_var="$shlibpath_var"]) +if test -n "$lt_cv_module_path_var"; then + m4_pattern_allow([LT_MODULE_PATH_VAR])dnl + AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"], + [Define to the name of the environment variable that determines the run-time module search path.]) +fi +])# LT_SYS_MODULE_PATH + +# Old name: +AU_ALIAS([AC_LTDL_SHLIBPATH], [LT_SYS_MODULE_PATH]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LTDL_SHLIBPATH], []) + + +# LT_SYS_DLSEARCH_PATH +# -------------------- +AC_DEFUN([LT_SYS_DLSEARCH_PATH], +[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl +AC_CACHE_CHECK([for the default library search path], + [lt_cv_sys_dlsearch_path], + [lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec"]) +if test -n "$lt_cv_sys_dlsearch_path"; then + sys_dlsearch_path= + for dir in $lt_cv_sys_dlsearch_path; do + if test -z "$sys_dlsearch_path"; then + sys_dlsearch_path="$dir" + else + sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir" + fi + done + m4_pattern_allow([LT_DLSEARCH_PATH])dnl + AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"], + [Define to the system default library search path.]) +fi +])# LT_SYS_DLSEARCH_PATH + +# Old name: +AU_ALIAS([AC_LTDL_SYSSEARCHPATH], [LT_SYS_DLSEARCH_PATH]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LTDL_SYSSEARCHPATH], []) + + +# _LT_CHECK_DLPREOPEN +# ------------------- +m4_defun([_LT_CHECK_DLPREOPEN], +[m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen], + [libltdl_cv_preloaded_symbols], + [if test -n "$lt_cv_sys_global_symbol_pipe"; then + libltdl_cv_preloaded_symbols=yes + else + libltdl_cv_preloaded_symbols=no + fi + ]) +if test x"$libltdl_cv_preloaded_symbols" = xyes; then + AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1], + [Define if libtool can extract symbol lists from object files.]) +fi +])# _LT_CHECK_DLPREOPEN + + +# LT_LIB_DLLOAD +# ------------- +AC_DEFUN([LT_LIB_DLLOAD], +[m4_pattern_allow([^LT_DLLOADERS$]) +LT_DLLOADERS= +AC_SUBST([LT_DLLOADERS]) + +AC_LANG_PUSH([C]) + +LIBADD_DLOPEN= +AC_SEARCH_LIBS([dlopen], [dl], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + if test "$ac_cv_search_dlopen" != "none required" ; then + LIBADD_DLOPEN="-ldl" + fi + libltdl_cv_lib_dl_dlopen="yes" + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H +# include +#endif + ]], [[dlopen(0, 0);]])], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + libltdl_cv_func_dlopen="yes" + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], + [AC_CHECK_LIB([svld], [dlopen], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes" + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])]) +if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes +then + lt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBADD_DLOPEN" + AC_CHECK_FUNCS([dlerror]) + LIBS="$lt_save_LIBS" +fi +AC_SUBST([LIBADD_DLOPEN]) + +LIBADD_SHL_LOAD= +AC_CHECK_FUNC([shl_load], + [AC_DEFINE([HAVE_SHL_LOAD], [1], + [Define if you have the shl_load function.]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"], + [AC_CHECK_LIB([dld], [shl_load], + [AC_DEFINE([HAVE_SHL_LOAD], [1], + [Define if you have the shl_load function.]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" + LIBADD_SHL_LOAD="-ldld"])]) +AC_SUBST([LIBADD_SHL_LOAD]) + +case $host_os in +darwin[[1567]].*) +# We only want this for pre-Mac OS X 10.4. + AC_CHECK_FUNC([_dyld_func_lookup], + [AC_DEFINE([HAVE_DYLD], [1], + [Define if you have the _dyld_func_lookup function.]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"]) + ;; +beos*) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" + ;; +cygwin* | mingw* | os2* | pw32*) + AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include ]]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" + ;; +esac + +AC_CHECK_LIB([dld], [dld_link], + [AC_DEFINE([HAVE_DLD], [1], + [Define if you have the GNU dld library.]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"]) +AC_SUBST([LIBADD_DLD_LINK]) + +m4_pattern_allow([^LT_DLPREOPEN$]) +LT_DLPREOPEN= +if test -n "$LT_DLLOADERS" +then + for lt_loader in $LT_DLLOADERS; do + LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " + done + AC_DEFINE([HAVE_LIBDLLOADER], [1], + [Define if libdlloader will be built on this platform]) +fi +AC_SUBST([LT_DLPREOPEN]) + +dnl This isn't used anymore, but set it for backwards compatibility +LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" +AC_SUBST([LIBADD_DL]) + +AC_LANG_POP +])# LT_LIB_DLLOAD + +# Old name: +AU_ALIAS([AC_LTDL_DLLIB], [LT_LIB_DLLOAD]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LTDL_DLLIB], []) + + +# LT_SYS_SYMBOL_USCORE +# -------------------- +# does the compiler prefix global symbols with an underscore? +AC_DEFUN([LT_SYS_SYMBOL_USCORE], +[m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +AC_CACHE_CHECK([for _ prefix in compiled symbols], + [lt_cv_sys_symbol_underscore], + [lt_cv_sys_symbol_underscore=no + cat > conftest.$ac_ext <<_LT_EOF +void nm_test_func(){} +int main(){nm_test_func;return 0;} +_LT_EOF + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + ac_nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then + # See whether the symbols have a leading underscore. + if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then + lt_cv_sys_symbol_underscore=yes + else + if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then + : + else + echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD + fi + fi + else + echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.c >&AS_MESSAGE_LOG_FD + fi + rm -rf conftest* + ]) + sys_symbol_underscore=$lt_cv_sys_symbol_underscore + AC_SUBST([sys_symbol_underscore]) +])# LT_SYS_SYMBOL_USCORE + +# Old name: +AU_ALIAS([AC_LTDL_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LTDL_SYMBOL_USCORE], []) + + +# LT_FUNC_DLSYM_USCORE +# -------------------- +AC_DEFUN([LT_FUNC_DLSYM_USCORE], +[AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl +if test x"$lt_cv_sys_symbol_underscore" = xyes; then + if test x"$libltdl_cv_func_dlopen" = xyes || + test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then + AC_CACHE_CHECK([whether we have to add an underscore for dlsym], + [libltdl_cv_need_uscore], + [libltdl_cv_need_uscore=unknown + save_LIBS="$LIBS" + LIBS="$LIBS $LIBADD_DLOPEN" + _LT_TRY_DLOPEN_SELF( + [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes], + [], [libltdl_cv_need_uscore=cross]) + LIBS="$save_LIBS" + ]) + fi +fi + +if test x"$libltdl_cv_need_uscore" = xyes; then + AC_DEFINE([NEED_USCORE], [1], + [Define if dlsym() requires a leading underscore in symbol names.]) +fi +])# LT_FUNC_DLSYM_USCORE + +# Old name: +AU_ALIAS([AC_LTDL_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], []) + diff --git a/acinclude/ltoptions.m4 b/acinclude/ltoptions.m4 new file mode 100644 index 0000000..d4df679 --- /dev/null +++ b/acinclude/ltoptions.m4 @@ -0,0 +1,370 @@ +############################################################################## +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## Macros to handle LT_INIT options. ## +## --------------------------------- ## + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [0], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + +## ----------------- ## +## LTDL_INIT Options ## +## ----------------- ## + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) + diff --git a/acinclude/ltsugar.m4 b/acinclude/ltsugar.m4 new file mode 100644 index 0000000..02a939d --- /dev/null +++ b/acinclude/ltsugar.m4 @@ -0,0 +1,125 @@ +############################################################################## +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) + diff --git a/acinclude/ltversion.m4 b/acinclude/ltversion.m4 new file mode 100644 index 0000000..83a83f2 --- /dev/null +++ b/acinclude/ltversion.m4 @@ -0,0 +1,25 @@ +############################################################################## +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# Generated from ltversion.in. + +# serial 3012 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.2.6]) +m4_define([LT_PACKAGE_REVISION], [1.3012]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.2.6' +macro_revision='1.3012' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) + diff --git a/acinclude/lt~obsolete.m4 b/acinclude/lt~obsolete.m4 new file mode 100644 index 0000000..3b2acd4 --- /dev/null +++ b/acinclude/lt~obsolete.m4 @@ -0,0 +1,93 @@ +############################################################################## +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 4 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..649d7b3 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# +echo "Generating build information using autoconf" +echo "This may take a while ..." + +# Regenerate configuration files +cat acinclude/* >aclocal.m4 +found=false +for autoconf in autoconf autoconf259 autoconf-2.59 +do if which $autoconf >/dev/null 2>&1; then $autoconf && found=true; break; fi +done +if test x$found = xfalse; then + echo "Couldn't find autoconf, aborting" + exit 1 +fi +(cd test; sh autogen.sh) + +# Run configure for this platform +echo "Now you are ready to run ./configure" diff --git a/build-scripts/config.guess b/build-scripts/config.guess new file mode 100755 index 0000000..e792aac --- /dev/null +++ b/build-scripts/config.guess @@ -0,0 +1,1494 @@ +#! /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 +# Free Software Foundation, Inc. + +timestamp='2009-09-18' + +# 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 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -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: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*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd | genuineintel) + 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:*:*) + echo ${UNAME_MACHINE}-pc-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:* | 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 | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + 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/build-scripts/config.sub b/build-scripts/config.sub new file mode 100755 index 0000000..5ecc18b --- /dev/null +++ b/build-scripts/config.sub @@ -0,0 +1,1700 @@ +#! /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 +# Free Software Foundation, Inc. + +timestamp='2009-10-07' + +# 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 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + 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 | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-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-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | 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-* \ + | tron-* \ + | 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 + ;; + 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 + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + 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. + -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* | -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-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 + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -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/build-scripts/fatbuild.sh b/build-scripts/fatbuild.sh new file mode 100755 index 0000000..b4b1616 --- /dev/null +++ b/build-scripts/fatbuild.sh @@ -0,0 +1,316 @@ +#!/bin/sh +# +# Build a fat binary on Mac OS X, thanks Ryan! + +# Number of CPUs (for make -j) +NCPU=`sysctl -n hw.ncpu` +NJOB=$NCPU +#NJOB=`expr $NCPU + 1` + +# Generic, cross-platform CFLAGS you always want go here. +CFLAGS="-O3 -g -pipe" + +# Locate Xcode SDK path +SDK_PATH=/Developer/SDKs +if [ ! -d $SDK_PATH ]; then + echo "Couldn't find SDK path" + exit 1 +fi + +# See if we can use 10.2 or 10.3 runtime compatibility +if [ -d "$SDK_PATH/MacOSX10.2.8.sdk" ]; then + # PowerPC configure flags (10.2 runtime compatibility) + # We dynamically load X11, so using the system X11 headers is fine. + CONFIG_PPC="--build=`uname -p`-apple-darwin --host=powerpc-apple-darwin \ +--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib" + + # PowerPC compiler flags + CC_PPC="gcc-3.3 -arch ppc" + CXX_PPC="g++-3.3 -arch ppc" + CFLAGS_PPC="" + CPPFLAGS_PPC="-DMAC_OS_X_VERSION_MIN_REQUIRED=1020 \ +-nostdinc \ +-F$SDK_PATH/MacOSX10.2.8.sdk/System/Library/Frameworks \ +-I$SDK_PATH/MacOSX10.2.8.sdk/usr/include/gcc/darwin/3.3 \ +-isystem $SDK_PATH/MacOSX10.2.8.sdk/usr/include" + + # PowerPC linker flags + LFLAGS_PPC="-Wl,-headerpad_max_install_names -arch ppc \ +-L$SDK_PATH/MacOSX10.2.8.sdk/usr/lib/gcc/darwin/3.3 \ +-F$SDK_PATH/MacOSX10.2.8.sdk/System/Library/Frameworks \ +-Wl,-syslibroot,$SDK_PATH/MacOSX10.2.8.sdk" + +else # 10.2 or 10.3 SDK + + # PowerPC configure flags (10.3 runtime compatibility) + # We dynamically load X11, so using the system X11 headers is fine. + CONFIG_PPC="--build=`uname -p`-apple-darwin --host=powerpc-apple-darwin \ +--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib" + + # PowerPC compiler flags + CC_PPC="gcc-4.0 -arch ppc" + CXX_PPC="g++-4.0 -arch ppc" + CFLAGS_PPC="" + CPPFLAGS_PPC="-DMAC_OS_X_VERSION_MIN_REQUIRED=1030 \ +-nostdinc \ +-F$SDK_PATH/MacOSX10.3.9.sdk/System/Library/Frameworks \ +-I$SDK_PATH/MacOSX10.3.9.sdk/usr/lib/gcc/powerpc-apple-darwin9/4.0.1/include \ +-isystem $SDK_PATH/MacOSX10.3.9.sdk/usr/include" + + # PowerPC linker flags + LFLAGS_PPC="-Wl,-headerpad_max_install_names -arch ppc -mmacosx-version-min=10.3 \ +-L$SDK_PATH/MacOSX10.3.9.sdk/usr/lib/gcc/powerpc-apple-darwin9/4.0.1 \ +-F$SDK_PATH/MacOSX10.3.9.sdk/System/Library/Frameworks \ +-Wl,-syslibroot,$SDK_PATH/MacOSX10.3.9.sdk" + +fi # 10.2 or 10.3 SDK + +# Intel configure flags (10.4 runtime compatibility) +# We dynamically load X11, so using the system X11 headers is fine. +CONFIG_X86="--build=`uname -p`-apple-darwin --host=i386-apple-darwin \ +--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib" + +# Intel compiler flags +CC_X86="gcc-4.0 -arch i386" +CXX_X86="g++-4.0 -arch i386" +CFLAGS_X86="-mmacosx-version-min=10.4" +CPPFLAGS_X86="-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \ +-nostdinc \ +-F$SDK_PATH/MacOSX10.4u.sdk/System/Library/Frameworks \ +-I$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1/include \ +-isystem $SDK_PATH/MacOSX10.4u.sdk/usr/include" + +# Intel linker flags +LFLAGS_X86="-Wl,-headerpad_max_install_names -arch i386 -mmacosx-version-min=10.4 \ +-L$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1 \ +-Wl,-syslibroot,$SDK_PATH/MacOSX10.4u.sdk" + +# +# Find the configure script +# +srcdir=`dirname $0`/.. +auxdir=$srcdir/build-scripts +cd $srcdir + +# +# Figure out which phase to build: +# all, +# configure, configure-ppc, configure-x86, +# make, make-ppc, make-x86, merge +# install +# clean +if test x"$1" = x; then + phase=all +else + phase="$1" +fi +case $phase in + all) + configure_ppc="yes" + configure_x86="yes" + make_ppc="yes" + make_x86="yes" + merge="yes" + ;; + configure) + configure_ppc="yes" + configure_x86="yes" + ;; + configure-ppc) + configure_ppc="yes" + ;; + configure-x86) + configure_x86="yes" + ;; + make) + make_ppc="yes" + make_x86="yes" + merge="yes" + ;; + make-ppc) + make_ppc="yes" + ;; + make-x86) + make_x86="yes" + ;; + merge) + merge="yes" + ;; + install) + install_bin="yes" + install_hdrs="yes" + install_lib="yes" + install_data="yes" + install_man="yes" + ;; + install-bin) + install_bin="yes" + ;; + install-hdrs) + install_hdrs="yes" + ;; + install-lib) + install_lib="yes" + ;; + install-data) + install_data="yes" + ;; + install-man) + install_man="yes" + ;; + clean) + clean_ppc="yes" + clean_x86="yes" + ;; + clean-ppc) + clean_ppc="yes" + ;; + clean-x86) + clean_x86="yes" + ;; + *) + echo "Usage: $0 [all|configure[-ppc|-x86]|make[-ppc|-x86]|merge|install|clean]" + exit 1 + ;; +esac +case `uname -p` in + powerpc) + native_path=ppc + ;; + *86) + native_path=x86 + ;; + *) + echo "Couldn't figure out native architecture path" + exit 1 + ;; +esac + +# +# Create the build directories +# +for dir in build build/ppc build/x86; do + if test -d $dir; then + : + else + mkdir $dir || exit 1 + fi +done + +# +# Build the PowerPC binary +# +if test x$configure_ppc = xyes; then + (cd build/ppc && \ + sh ../../configure $CONFIG_PPC CC="$CC_PPC" CXX="$CXX_PPC" CFLAGS="$CFLAGS $CFLAGS_PPC" CPPFLAGS="$CPPFLAGS_PPC" LDFLAGS="$LFLAGS_PPC") || exit 2 +fi +if test x$make_ppc = xyes; then + (cd build/ppc && ls include && make -j$NJOB) || exit 3 +fi + +# +# Build the Intel binary +# +if test x$configure_x86 = xyes; then + (cd build/x86 && \ + sh ../../configure $CONFIG_X86 CC="$CC_X86" CXX="$CXX_X86" CFLAGS="$CFLAGS $CFLAGS_X86" CPPFLAGS="$CPPFLAGS_X86" LDFLAGS="$LFLAGS_X86") || exit 2 +fi +if test x$make_x86 = xyes; then + (cd build/x86 && make -j$NJOB) || exit 3 +fi + +# +# Combine into fat binary +# +if test x$merge = xyes; then + output=.libs + sh $auxdir/mkinstalldirs build/$output + cd build + target=`find . -mindepth 3 -type f -name '*.dylib' | head -1 | sed 's|.*/||'` + (lipo -create -o $output/$target `find . -mindepth 3 -type f -name "*.dylib"` && + ln -sf $target $output/libSDL-1.2.0.dylib && + ln -sf $target $output/libSDL.dylib && + lipo -create -o $output/libSDL.a */build/.libs/libSDL.a && + cp $native_path/build/.libs/libSDL.la $output && + cp $native_path/build/.libs/libSDL.lai $output && + cp $native_path/build/libSDL.la . && + lipo -create -o libSDLmain.a */build/libSDLmain.a && + echo "Build complete!" && + echo "Files can be found in the build directory.") || exit 4 + cd .. +fi + +# +# Install +# +do_install() +{ + echo $* + $* || exit 5 +} +if test x$prefix = x; then + prefix=/usr/local +fi +if test x$exec_prefix = x; then + exec_prefix=$prefix +fi +if test x$bindir = x; then + bindir=$exec_prefix/bin +fi +if test x$libdir = x; then + libdir=$exec_prefix/lib +fi +if test x$includedir = x; then + includedir=$prefix/include +fi +if test x$datadir = x; then + datadir=$prefix/share +fi +if test x$mandir = x; then + mandir=$prefix/man +fi +if test x$install_bin = xyes; then + do_install sh $auxdir/mkinstalldirs $bindir + do_install /usr/bin/install -c -m 755 build/$native_path/sdl-config $bindir/sdl-config +fi +if test x$install_hdrs = xyes; then + do_install sh $auxdir/mkinstalldirs $includedir/SDL + for src in $srcdir/include/*.h; do \ + file=`echo $src | sed -e 's|^.*/||'`; \ + do_install /usr/bin/install -c -m 644 $src $includedir/SDL/$file; \ + done + do_install /usr/bin/install -c -m 644 $srcdir/include/SDL_config_macosx.h $includedir/SDL/SDL_config.h +fi +if test x$install_lib = xyes; then + do_install sh $auxdir/mkinstalldirs $libdir + do_install sh build/$native_path/libtool --mode=install /usr/bin/install -c build/libSDL.la $libdir/libSDL.la + do_install /usr/bin/install -c -m 644 build/libSDLmain.a $libdir/libSDLmain.a + do_install ranlib $libdir/libSDLmain.a +fi +if test x$install_data = xyes; then + do_install sh $auxdir/mkinstalldirs $datadir/aclocal + do_install /usr/bin/install -c -m 644 $srcdir/sdl.m4 $datadir/aclocal/sdl.m4 +fi +if test x$install_man = xyes; then + do_install sh $auxdir/mkinstalldirs $mandir/man3 + for src in $srcdir/docs/man3/*.3; do \ + file=`echo $src | sed -e 's|^.*/||'`; \ + do_install /usr/bin/install -c -m 644 $src $mandir/man3/$file; \ + done +fi + +# +# Clean up +# +do_clean() +{ + echo $* + $* || exit 6 +} +if test x$clean_x86 = xyes; then + do_clean rm -r build/x86 +fi +if test x$clean_ppc = xyes; then + do_clean rm -r build/ppc +fi + diff --git a/build-scripts/install-sh b/build-scripts/install-sh new file mode 100755 index 0000000..1a83534 --- /dev/null +++ b/build-scripts/install-sh @@ -0,0 +1,323 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2005-02-02.21 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +chmodcmd="$chmodprog 0755" +chowncmd= +chgrpcmd= +stripcmd= +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src= +dst= +dir_arg= +dstarg= +no_target_directory= + +usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: +-c (ignored) +-d create directories instead of installing files. +-g GROUP $chgrpprog installed files to GROUP. +-m MODE $chmodprog installed files to MODE. +-o USER $chownprog installed files to USER. +-s $stripprog installed files. +-t DIRECTORY install into DIRECTORY. +-T report an error if DSTFILE is a directory. +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test -n "$1"; do + case $1 in + -c) shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit $?;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t) dstarg=$2 + shift + shift + continue;; + + -T) no_target_directory=true + shift + continue;; + + --version) echo "$0 $scriptversion"; exit $?;; + + *) # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + test -n "$dir_arg$dstarg" && break + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done + break;; + esac +done + +if test -z "$1"; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac + + if test -n "$dir_arg"; then + dst=$src + src= + + if test -d "$dst"; then + mkdircmd=: + chmodcmd= + else + mkdircmd=$mkdirprog + fi + else + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dstarg: Is a directory" >&2 + exit 1 + fi + dst=$dst/`basename "$src"` + fi + fi + + # This sed command emulates the dirname command. + dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` + + # Make sure that the destination directory exists. + + # Skip lots of stat calls in the usual case. + if test ! -d "$dstdir"; then + defaultIFS=' + ' + IFS="${IFS-$defaultIFS}" + + oIFS=$IFS + # Some sh's can't handle IFS=/ for some reason. + IFS='%' + set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` + shift + IFS=$oIFS + + pathcomp= + + while test $# -ne 0 ; do + pathcomp=$pathcomp$1 + shift + if test ! -d "$pathcomp"; then + $mkdirprog "$pathcomp" + # mkdir can fail with a `File exist' error in case several + # install-sh are creating the directory concurrently. This + # is OK. + test -d "$pathcomp" || exit + fi + pathcomp=$pathcomp/ + done + fi + + if test -n "$dir_arg"; then + $doit $mkdircmd "$dst" \ + && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } + + else + dstfile=`basename "$dst"` + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + trap '(exit $?); exit' 1 2 13 15 + + # Copy the file name to the temp name. + $doit $cpprog "$src" "$dsttmp" && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + if test -f "$dstdir/$dstfile"; then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ + || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ + || { + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 + (exit 1); exit 1 + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" + } + } + fi || { (exit 1); exit 1; } +done + +# The final little trick to "correctly" pass the exit status to the exit trap. +{ + (exit 0); exit 0 +} + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/build-scripts/ltmain.sh b/build-scripts/ltmain.sh new file mode 100644 index 0000000..d2b860f --- /dev/null +++ b/build-scripts/ltmain.sh @@ -0,0 +1,8407 @@ +# Generated from ltmain.m4sh. + +# ltmain.sh (GNU libtool) 2.2.6 +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [OPTION]... [MODE-ARG]... +# +# Provide generalized library-building support services. +# +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print informational messages (default) +# --version print version information +# -h, --help print short or long help message +# +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.2.6 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . + +PROGRAM=ltmain.sh +PACKAGE=libtool +VERSION=2.2.6 +TIMESTAMP="" +package_revision=1.3012 + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# NLS nuisances: We save the old values to restore during execute mode. +# Only set LANG and LC_ALL to C if already set. +# These must not be set unconditionally because not all systems understand +# e.g. LANG=C (notably SCO). +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done + +$lt_unset CDPATH + + + + + +: ${CP="cp -f"} +: ${ECHO="echo"} +: ${EGREP="/usr/bin/grep -E"} +: ${FGREP="/usr/bin/grep -F"} +: ${GREP="/usr/bin/grep"} +: ${LN_S="ln -s"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SED="/opt/local/bin/gsed"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +exit_status=$EXIT_SUCCESS + +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" + +dirname="s,/[^/]*$,," +basename="s,^.*/,," + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + +# Generated shell functions inserted here. + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + +# The name of this program: +# In the unlikely event $progname began with a '-', it would play havoc with +# func_echo (imagine progname=-n), so we prepend ./ in that case: +func_dirname_and_basename "$progpath" +progname=$func_basename_result +case $progname in + -*) progname=./$progname ;; +esac + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=: + for progdir in $PATH; do + IFS="$save_IFS" + test -x "$progdir/$progname" && break + done + IFS="$save_IFS" + test -n "$progdir" || progdir=`pwd` + progpath="$progdir/$progname" + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed="${SED}"' -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" + +# Standard options: +opt_dry_run=false +opt_help=false +opt_quiet=false +opt_verbose=false +opt_warning=: + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname${mode+: }$mode: $*" +} + +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +} + +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help="Try \`$progname --help' for more information." ## default + + +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + my_directory_path="$1" + my_dir_list= + + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" + + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` + done + my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "X$my_tmpdir" | $Xsed +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "X$1" | $Xsed \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + + + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $SED -n '/^# Usage:/,/# -h/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + $ECHO + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help +# Echo long help message to standard output and exit. +func_help () +{ + $SED -n '/^# Usage:/,/# Report bugs to/ { + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ + p + }' < "$progpath" + exit $? +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + func_error "missing argument for $1" + exit_cmd=exit +} + +exit_cmd=: + + + + + +# Check that we have a working $ECHO. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell, and then maybe $ECHO will work. + exec $SHELL "$progpath" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + +# Parse options once, thoroughly. This comes as soon as possible in +# the script to make things like `libtool --version' happen quickly. +{ + + # Shorthand for --mode=foo, only valid as the first argument + case $1 in + clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; + compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; + execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; + finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; + install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; + link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; + esac + + # Parse non-mode specific arguments: + while test "$#" -gt 0; do + opt="$1" + shift + + case $opt in + --config) func_config ;; + + --debug) preserve_args="$preserve_args $opt" + func_echo "enabling shell trace mode" + opt_debug='set -x' + $opt_debug + ;; + + -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break + execute_dlfiles="$execute_dlfiles $1" + shift + ;; + + --dry-run | -n) opt_dry_run=: ;; + --features) func_features ;; + --finish) mode="finish" ;; + + --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break + case $1 in + # Valid mode arguments: + clean) ;; + compile) ;; + execute) ;; + finish) ;; + install) ;; + link) ;; + relink) ;; + uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; + esac + + mode="$1" + shift + ;; + + --preserve-dup-deps) + opt_duplicate_deps=: ;; + + --quiet|--silent) preserve_args="$preserve_args $opt" + opt_silent=: + ;; + + --verbose| -v) preserve_args="$preserve_args $opt" + opt_silent=false + ;; + + --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break + preserve_args="$preserve_args $opt $1" + func_enable_tag "$1" # tagname is set here + shift + ;; + + # Separate optargs to long options: + -dlopen=*|--mode=*|--tag=*) + func_opt_split "$opt" + set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} + shift + ;; + + -\?|-h) func_usage ;; + --help) opt_help=: ;; + --version) func_version ;; + + -*) func_fatal_help "unrecognized option \`$opt'" ;; + + *) nonopt="$opt" + break + ;; + esac + done + + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_duplicate_deps + ;; + esac + + # Having warned about all mis-specified options, bail out if + # anything was wrong. + $exit_cmd $EXIT_FAILURE +} + +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +## ----------- ## +## Main. ## +## ----------- ## + +$opt_help || { + # Sanity checks first: + func_check_version_match + + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + + test -z "$mode" && func_fatal_error "error: you must specify a MODE." + + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$mode' for more information." +} + + +# func_lalib_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if `file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case "$lalib_p_line" in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test "$lalib_p" = yes +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + func_lalib_p "$1" +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_ltwrapper_scriptname_result="" + if func_ltwrapper_executable_p "$1"; then + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" + fi +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $opt_debug + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$save_ifs + eval cmd=\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# `FILE.' does not work on cygwin managed mounts. +func_source () +{ + $opt_debug + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $opt_debug + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" + done + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" + done + case "$@ " in + " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with \`--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' + else + write_lobj=none + fi + + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T <?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + removelist="$removelist $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + removelist="$removelist $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test "$pic_mode" != no; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + command="$command -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test "$suppress_opt" = yes; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test "$compiler_c_o" = yes; then + command="$command -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + command="$command$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { +test "$mode" = compile && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode \`$mode'" + ;; + esac + + $ECHO + $ECHO "Try \`$progname --help' for more information about other modes." + + exit $? +} + + # Now that we've collected a possible --mode arg, show help if necessary + $opt_help && func_mode_help + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # The first argument is the command name. + cmd="$nonopt" + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + test -f "$file" \ + || func_fatal_help "\`$file' is not a file" + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "\`$file' was not linked with \`-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir="$func_dirname_result" + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir="$func_dirname_result" + ;; + + *) + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -*) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file="$progdir/$program" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_quote_for_eval "$file" + args="$args $func_quote_for_eval_result" + done + + if test "X$opt_dry_run" = Xfalse; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + $ECHO "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + fi +} + +test "$mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_silent && exit $EXIT_SUCCESS + + $ECHO "X----------------------------------------------------------------------" | $Xsed + $ECHO "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + $ECHO + $ECHO "If you ever happen to want to link against installed libraries" + $ECHO "in a given directory, LIBDIR, you must either use libtool, and" + $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" + $ECHO "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" + $ECHO " during execution" + fi + if test -n "$runpath_var"; then + $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" + $ECHO " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + $ECHO + + $ECHO "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual" + $ECHO "pages." + ;; + *) + $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + $ECHO "X----------------------------------------------------------------------" | $Xsed + exit $EXIT_SUCCESS +} + +test "$mode" = finish && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $opt_debug + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + $ECHO "X$nonopt" | $GREP shtool >/dev/null; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + install_prog="$install_prog$func_quote_for_eval_result" + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + for arg + do + if test -n "$dest"; then + files="$files $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + case " $install_prog " in + *[\\\ /]cp\ *) ;; + *) prev=$arg ;; + esac + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + install_prog="$install_prog $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir="$func_dirname_result" + destname="$func_basename_result" + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "\`$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "\`$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + staticlibs="$staticlibs $file" + ;; + + *.la) + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir="$func_dirname_result" + dir="$dir$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname="$1" + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme="$stripme" + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name="$func_basename_result" + instname="$dir/$name"i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to \`$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script \`$wrapper'" + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" = yes; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file="$func_basename_result" + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file="$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name="$func_basename_result" + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run \`$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test "$mode" = install && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms="${my_outputname}S.c" + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${my_outputname}.nm" + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_verbose "extracting global C symbols from \`$progfile'" + $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $opt_dry_run || { + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from \`$dlprefile'" + func_basename "$dlprefile" + name="$func_basename_result" + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + $ECHO >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +" + case $host in + *cygwin* | *mingw* | *cegcc* ) + $ECHO >> "$output_objdir/$my_dlsyms" "\ +/* DATA imports from DLLs on WIN32 con't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs. */" + lt_dlsym_const= ;; + *osf5*) + echo >> "$output_objdir/$my_dlsyms" "\ +/* This system does not cope well with relocations in const data */" + lt_dlsym_const= ;; + *) + lt_dlsym_const=const ;; + esac + + $ECHO >> "$output_objdir/$my_dlsyms" "\ +extern $lt_dlsym_const lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[]; +$lt_dlsym_const lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{\ + { \"$my_originator\", (void *) 0 }," + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + $ECHO >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) symtab_cflags="$symtab_cflags $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + + # Transform the symbol file into the correct name. + symfileobj="$output_objdir/${my_outputname}S.$objext" + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for \`$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + fi +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +func_win32_libid () +{ + $opt_debug + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | + $SED -n -e ' + 1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $opt_debug + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib="$func_basename_result" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`basename "$darwin_archive"` + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +} + + + +# func_emit_wrapper_part1 [arg=no] +# +# Emit the first part of a libtool wrapper script on stdout. +# For more information, see the description associated with +# func_emit_wrapper(), below. +func_emit_wrapper_part1 () +{ + func_emit_wrapper_part1_arg1=no + if test -n "$1" ; then + func_emit_wrapper_part1_arg1=$1 + fi + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='${SED} -e 1s/^X//' +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + ECHO=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$ECHO works! + : + else + # Restart under the correct shell, and then maybe \$ECHO will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ +" + $ECHO "\ + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + done +" +} +# end: func_emit_wrapper_part1 + +# func_emit_wrapper_part2 [arg=no] +# +# Emit the second part of a libtool wrapper script on stdout. +# For more information, see the description associated with +# func_emit_wrapper(), below. +func_emit_wrapper_part2 () +{ + func_emit_wrapper_part2_arg1=no + if test -n "$1" ; then + func_emit_wrapper_part2_arg1=$1 + fi + + $ECHO "\ + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} +# end: func_emit_wrapper_part2 + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=no + if test -n "$1" ; then + func_emit_wrapper_arg1=$1 + fi + + # split this up so that func_emit_cwrapperexe_src + # can call each part independently. + func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" + func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" +} + + +# func_to_host_path arg +# +# Convert paths to host format when used with build tools. +# Intended for use with "native" mingw (where libtool itself +# is running under the msys shell), or in the following cross- +# build environments: +# $build $host +# mingw (msys) mingw [e.g. native] +# cygwin mingw +# *nix + wine mingw +# where wine is equipped with the `winepath' executable. +# In the native mingw case, the (msys) shell automatically +# converts paths for any non-msys applications it launches, +# but that facility isn't available from inside the cwrapper. +# Similar accommodations are necessary for $host mingw and +# $build cygwin. Calling this function does no harm for other +# $host/$build combinations not listed above. +# +# ARG is the path (on $build) that should be converted to +# the proper representation for $host. The result is stored +# in $func_to_host_path_result. +func_to_host_path () +{ + func_to_host_path_result="$1" + if test -n "$1" ; then + case $host in + *mingw* ) + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + case $build in + *mingw* ) # actually, msys + # awkward: cmd appends spaces to result + lt_sed_strip_trailing_spaces="s/[ ]*\$//" + func_to_host_path_tmp1=`( cmd //c echo "$1" |\ + $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` + func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_path_tmp1=`cygpath -w "$1"` + func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + * ) + # Unfortunately, winepath does not exit with a non-zero + # error code, so we are forced to check the contents of + # stdout. On the other hand, if the command is not + # found, the shell will set an exit code of 127 and print + # *an error message* to stdout. So we must check for both + # error code of zero AND non-empty stdout, which explains + # the odd construction: + func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` + if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then + func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ + $SED -e "$lt_sed_naive_backslashify"` + else + # Allow warning below. + func_to_host_path_result="" + fi + ;; + esac + if test -z "$func_to_host_path_result" ; then + #func_error "Could not determine host path corresponding to" + #func_error " '$1'" + #func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_path_result="$1" + fi + ;; + esac + fi +} +# end: func_to_host_path + +# func_to_host_pathlist arg +# +# Convert pathlists to host format when used with build tools. +# See func_to_host_path(), above. This function supports the +# following $build/$host combinations (but does no harm for +# combinations not listed here): +# $build $host +# mingw (msys) mingw [e.g. native] +# cygwin mingw +# *nix + wine mingw +# +# Path separators are also converted from $build format to +# $host format. If ARG begins or ends with a path separator +# character, it is preserved (but converted to $host format) +# on output. +# +# ARG is a pathlist (on $build) that should be converted to +# the proper representation on $host. The result is stored +# in $func_to_host_pathlist_result. +func_to_host_pathlist () +{ + func_to_host_pathlist_result="$1" + if test -n "$1" ; then + case $host in + *mingw* ) + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_to_host_pathlist_tmp2="$1" + # Once set for this call, this variable should not be + # reassigned. It is used in tha fallback case. + func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ + $SED -e 's|^:*||' -e 's|:*$||'` + case $build in + *mingw* ) # Actually, msys. + # Awkward: cmd appends spaces to result. + lt_sed_strip_trailing_spaces="s/[ ]*\$//" + func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ + $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + * ) + # unfortunately, winepath doesn't convert pathlists + func_to_host_pathlist_result="" + func_to_host_pathlist_oldIFS=$IFS + IFS=: + for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do + IFS=$func_to_host_pathlist_oldIFS + if test -n "$func_to_host_pathlist_f" ; then + func_to_host_path "$func_to_host_pathlist_f" + if test -n "$func_to_host_path_result" ; then + if test -z "$func_to_host_pathlist_result" ; then + func_to_host_pathlist_result="$func_to_host_path_result" + else + func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" + fi + fi + fi + IFS=: + done + IFS=$func_to_host_pathlist_oldIFS + ;; + esac + if test -z "$func_to_host_pathlist_result" ; then + func_error "Could not determine the host path(s) corresponding to" + func_error " '$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This may break if $1 contains DOS-style drive + # specifications. The fix is not to complicate the expression + # below, but for the user to provide a working wine installation + # with winepath so that path translation in the cross-to-mingw + # case works properly. + lt_replace_pathsep_nix_to_dos="s|:|;|g" + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ + $SED -e "$lt_replace_pathsep_nix_to_dos"` + fi + # Now, add the leading and trailing path separators back + case "$1" in + :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" + ;; + esac + case "$1" in + *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" + ;; + esac + ;; + esac + fi +} +# end: func_to_host_pathlist + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +# define setmode _setmode +#else +# include +# include +# ifdef __CYGWIN__ +# include +# define HAVE_SETENV +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +#ifdef _MSC_VER +# define S_IXUSR _S_IEXEC +# define stat _stat +# ifndef _INTPTR_T_DEFINED +# define intptr_t int +# endif +#endif + +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifdef __CYGWIN__ +# define FOPEN_WB "wb" +#endif + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +#undef LTWRAPPER_DEBUGPRINTF +#if defined DEBUGWRAPPER +# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args +static void +ltwrapper_debugprintf (const char *fmt, ...) +{ + va_list args; + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); +} +#else +# define LTWRAPPER_DEBUGPRINTF(args) +#endif + +const char *program_name = NULL; + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_fatal (const char *message, ...); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_opt_process_env_set (const char *arg); +void lt_opt_process_env_prepend (const char *arg); +void lt_opt_process_env_append (const char *arg); +int lt_split_name_value (const char *arg, char** name, char** value); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); + +static const char *script_text_part1 = +EOF + + func_emit_wrapper_part1 yes | + $SED -e 's/\([\\"]\)/\\\1/g' \ + -e 's/^/ "/' -e 's/$/\\n"/' + echo ";" + cat <"))); + for (i = 0; i < newargc; i++) + { + LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); + } + +EOF + + case $host_os in + mingw*) + cat <<"EOF" + /* execv doesn't actually work on mingw as expected on unix */ + rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); + if (rval == -1) + { + /* failed to start process */ + LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); + return 127; + } + return rval; +EOF + ;; + *) + cat <<"EOF" + execv (lt_argv_zero, newargz); + return rval; /* =127, but avoids unused variable warning */ +EOF + ;; + esac + + cat <<"EOF" +} + +void * +xmalloc (size_t num) +{ + void *p = (void *) malloc (num); + if (!p) + lt_fatal ("Memory exhausted"); + + return p; +} + +char * +xstrdup (const char *string) +{ + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), + string) : NULL; +} + +const char * +base_name (const char *name) +{ + const char *base; + +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha ((unsigned char) name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return base; +} + +int +check_executable (const char *path) +{ + struct stat st; + + LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", + path ? (*path ? path : "EMPTY!") : "NULL!")); + if ((!path) || (!*path)) + return 0; + + if ((stat (path, &st) >= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", + path ? (*path ? path : "EMPTY!") : "NULL!")); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char *concat_name; + + LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", + wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", + tmp_pathspec)); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + char *errstr = strerror (errno); + lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal ("Could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp (str, pat) == 0) + *str = '\0'; + } + return str; +} + +static void +lt_error_core (int exit_status, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s: %s: ", program_name, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + va_end (ap); +} + +void +lt_setenv (const char *name, const char *value) +{ + LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", + (name ? name : ""), + (value ? value : ""))); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + int len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + int orig_value_len = strlen (orig_value); + int add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +int +lt_split_name_value (const char *arg, char** name, char** value) +{ + const char *p; + int len; + if (!arg || !*arg) + return 1; + + p = strchr (arg, (int)'='); + + if (!p) + return 1; + + *value = xstrdup (++p); + + len = strlen (arg) - strlen (*value); + *name = XMALLOC (char, len); + strncpy (*name, arg, len-1); + (*name)[len - 1] = '\0'; + + return 0; +} + +void +lt_opt_process_env_set (const char *arg) +{ + char *name = NULL; + char *value = NULL; + + if (lt_split_name_value (arg, &name, &value) != 0) + { + XFREE (name); + XFREE (value); + lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); + } + + lt_setenv (name, value); + XFREE (name); + XFREE (value); +} + +void +lt_opt_process_env_prepend (const char *arg) +{ + char *name = NULL; + char *value = NULL; + char *new_value = NULL; + + if (lt_split_name_value (arg, &name, &value) != 0) + { + XFREE (name); + XFREE (value); + lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); + } + + new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + XFREE (name); + XFREE (value); +} + +void +lt_opt_process_env_append (const char *arg) +{ + char *name = NULL; + char *value = NULL; + char *new_value = NULL; + + if (lt_split_name_value (arg, &name, &value) != 0) + { + XFREE (name); + XFREE (value); + lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); + } + + new_value = lt_extend_str (getenv (name), value, 1); + lt_setenv (name, new_value); + XFREE (new_value); + XFREE (name); + XFREE (value); +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + (name ? name : ""), + (value ? value : ""))); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[len-1] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + (name ? name : ""), + (value ? value : ""))); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + + +EOF +} +# end: func_emit_cwrapperexe_src + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module="${wl}-single_module" + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + test -f "$arg" \ + || func_fatal_error "symbol file \`$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) deplibs="$deplibs $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file \`$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + weak) + weak_libs="$weak_libs $arg" + prev= + continue + ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "\`-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname '-L' '' "$arg" + dir=$func_stripname_result + if test -z "$dir"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between \`-L' and \`$1'" + else + func_fatal_error "need path for \`-L' option" + fi + fi + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "*) ;; + *) + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot) + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; + esac + continue + ;; + + -multi_module) + single_module="${wl}-multi_module" + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + arg="$arg $wl$func_quote_for_eval_result" + compiler_flags="$compiler_flags $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + arg="$arg $wl$func_quote_for_eval_result" + compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" + linker_flags="$linker_flags $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler + # -r[0-9][0-9]* specifies the processor on the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler + # +DA*, +DD* enable 64-bit mode on the HP compiler + # -q* pass through compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -F/path gives path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC + # @file GCC response files + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" + func_append finalize_command " $arg" + compiler_flags="$compiler_flags $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + *.$objext) + # A standard object. + objs="$objs $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the \`$prevarg' option requires an argument" + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname="$func_basename_result" + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_duplicate_deps ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + libs="$libs $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + esac + pre_post_deps="$pre_post_deps $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test "$linkmode,$pass" = "lib,link"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs="$tmp_deplibs" + fi + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test "$linkmode,$pass" = "lib,dlpreopen"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + case $lib in + *.la) func_source "$lib" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` + case " $weak_libs " in + *" $deplib_base "*) ;; + *) deplibs="$deplibs $deplib" ;; + esac + done + done + libs="$dlprefiles" + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags="$compiler_flags $deplib" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test "$linkmode" = lib; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + *.ltframework) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + newlib_search_path="$newlib_search_path $func_stripname_result" + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + newlib_search_path="$newlib_search_path $func_stripname_result" + ;; + *) + func_warning "\`-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + func_stripname '-R' '' "$deplib" + dir=$func_stripname_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + $ECHO + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have" + $ECHO "*** because the file extensions .$libext of this argument makes me believe" + $ECHO "*** that it is just a static archive that I should not use here." + else + $ECHO + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + ;; + esac + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + + if test "$found" = yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "\`$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + dlprefiles="$dlprefiles $lib $dependency_libs" + else + newdlfiles="$newdlfiles $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir="$ladir" + fi + ;; + esac + func_basename "$lib" + laname="$func_basename_result" + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + newlib_search_path="$newlib_search_path $func_stripname_result" + ;; + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath:" in + *"$absdir:"*) ;; + *) temp_rpath="$temp_rpath$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + notinst_deplibs="$notinst_deplibs $lib" + need_relink=no + ;; + *) + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule="" + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule="$dlpremoduletest" + break + fi + done + if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then + $ECHO + if test "$linkmode" = prog; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname="$1" + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc*) + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + func_basename "$soroot" + soname="$func_basename_result" + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from \`$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for \`$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we can not + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null ; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + $ECHO + $ECHO "*** And there doesn't seem to be a static archive available" + $ECHO "*** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + elif test -n "$old_library"; then + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && + test "$hardcode_minus_L" != yes && + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + $ECHO + $ECHO "*** Warning: This system can not link to static lib archive $lib." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + $ECHO "*** But as you try to build a module library, libtool will still create " + $ECHO "*** a static module, that should work as long as the dlopening application" + $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + $ECHO + $ECHO "*** However, this would only work if libtool was able to extract symbol" + $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" + $ECHO "*** not find such a program. So, this module is probably useless." + $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + case $deplib in + -L*) path="$deplib" ;; + *.la) + func_dirname "$deplib" "" "." + dir="$func_dirname_result" + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of \`$dir'" + absdir="$dir" + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" + path= + fi + fi + ;; + *) + path="-L$absdir/$objdir" + ;; + esac + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "\`$deplib' seems to be moved" + + path="-L$absdir" + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test "$pass" = link; then + if test "$linkmode" = "prog"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + fi + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "\`-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "\`-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs="$objs$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" + + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" + else + $ECHO + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi + + test "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir="$1" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "\`-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + shift + IFS="$save_ifs" + + test -n "$7" && \ + func_fatal_help "too many parameters to \`-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$1" + number_minor="$2" + number_revision="$3" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + darwin|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + esac + ;; + no) + current="$1" + revision="$2" + age="$3" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + qnx) + major=".$current" + versuffix=".$current" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + + *) + func_fatal_configuration "unknown library version type \`$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + + fi + + func_generate_dlsyms "$libname" "$libname" "yes" + libobjs="$libobjs $symfileobj" + test "X$libobjs" = "X " && libobjs= + + if test "$mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + removelist="$removelist $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` + # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` + # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$deplibs -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $ECHO + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have" + $ECHO "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $ECHO + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have" + $ECHO "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ + -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` + done + fi + if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | + $GREP . >/dev/null; then + $ECHO + if test "X$deplibs_check_method" = "Xnone"; then + $ECHO "*** Warning: inter-library dependencies are not supported in this platform." + else + $ECHO "*** Warning: inter-library dependencies are not known to be supported." + fi + $ECHO "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + fi + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + $ECHO + $ECHO "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + $ECHO "*** a static module, that should work as long as the dlopening" + $ECHO "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + $ECHO + $ECHO "*** However, this would only work if libtool was able to extract symbol" + $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" + $ECHO "*** not find such a program. So, this module is probably useless." + $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + $ECHO "*** The inter-library dependencies that have been dropped here will be" + $ECHO "*** automatically added whenever a program is linked with this library" + $ECHO "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + $ECHO + $ECHO "*** Since this library must not contain undefined symbols," + $ECHO "*** because either the platform does not support them or" + $ECHO "*** it was explicitly requested with -no-undefined," + $ECHO "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + deplibs="$new_libs" + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + if test -n "$hardcode_libdir_flag_spec_ld"; then + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname="$1" + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + linknames="$linknames $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols="$output_objdir/$libname.uexp" + delfiles="$delfiles $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols="$export_symbols" + export_symbols= + always_export_symbols=yes + fi + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + func_len " $cmd" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' + fi + + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs="$tmp_deplibs $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test "$compiler_needs_object" = yes && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + output_la=`$ECHO "X$output" | $Xsed -e "$basename"` + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript + func_verbose "creating GNU ld script: $output" + $ECHO 'INPUT (' > $output + for obj in $save_libobjs + do + $ECHO "$obj" >> $output + done + $ECHO ')' >> $output + delfiles="$delfiles $output" + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test "$compiler_needs_object" = yes; then + firstobj="$1 " + shift + fi + for obj + do + $ECHO "$obj" >> $output + done + delfiles="$delfiles $output" + output=$firstobj\"$file_list_spec$output\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-${k}.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test "X$objlist" = X || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + else + # All subsequent reloadable object files will link in + # the last one created. + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-${k}.$objext + objlist=$obj + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + if test -n "$last_robj"; then + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi + delfiles="$delfiles $output" + + else + output= + fi + + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + fi + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + if ${skipped_export-false}; then + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + fi + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $dlprefiles + libobjs="$libobjs $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "\`-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object \`$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "\`-release' is ignored for programs" + + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test "$tagname" = CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=yes + case $host in + *cygwin* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + *cegcc) + # Disable wrappers for cegcc, we are cross compiling anyway. + wrappers_required=no + ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + esac + if test "$wrappers_required" = no; then + # Replace the output file specification. + compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + fi + + exit $exit_status + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` + fi + + # Quote $ECHO for shipping. + if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; + esac + qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save $symfileobj" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + if test "$preload" = yes && test -f "$symfileobj"; then + oldobjs="$oldobjs $symfileobj" + fi + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $addlibs + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $dlprefiles + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + $ECHO "copying selected object files to avoid basename conflicts..." + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase="$func_basename_result" + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + newdlfiles="$newdlfiles $libdir/$name" + ;; + *) newdlfiles="$newdlfiles $lib" ;; + esac + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + newdlprefiles="$newdlprefiles $libdir/$name" + ;; + esac + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + done + dlprefiles="$newdlprefiles" + fi + $RM $output + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +{ test "$mode" = link || test "$mode" = relink; } && + func_mode_link ${1+"$@"} + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $opt_debug + RM="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) RM="$RM $arg"; rmforce=yes ;; + -*) RM="$RM $arg" ;; + *) files="$files $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + origobjdir="$objdir" + for file in $files; do + func_dirname "$file" "" "." + dir="$func_dirname_result" + if test "X$dir" = X.; then + objdir="$origobjdir" + else + objdir="$dir/$origobjdir" + fi + func_basename "$file" + name="$func_basename_result" + test "$mode" = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $objdir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + + case "$mode" in + clean) + case " $library_names " in + # " " in the beginning catches empty $dlname + *" $dlname "*) ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; + esac + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && + test "$pic_object" != none; then + rmfiles="$rmfiles $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && + test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$mode" = clean ; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + rmfiles="$rmfiles $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + rmfiles="$rmfiles $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + objdir="$origobjdir" + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +{ test "$mode" = uninstall || test "$mode" = clean; } && + func_mode_uninstall ${1+"$@"} + +test -z "$mode" && { + help="$generic_help" + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode \`$mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: +# vi:sw=2 + diff --git a/build-scripts/makedep.sh b/build-scripts/makedep.sh new file mode 100755 index 0000000..ceffe27 --- /dev/null +++ b/build-scripts/makedep.sh @@ -0,0 +1,93 @@ +#!/bin/sh +# +# Generate dependencies from a list of source files + +# Check to make sure our environment variables are set +if test x"$INCLUDE" = x -o x"$SOURCES" = x -o x"$output" = x; then + echo "SOURCES, INCLUDE, and output needs to be set" + exit 1 +fi +cache_prefix=".#$$" + +generate_var() +{ + echo $1 | sed -e 's|^.*/||' -e 's|\.|_|g' +} + +search_deps() +{ + base=`echo $1 | sed 's|/[^/]*$||'` + grep '#include "' <$1 | sed -e 's|.*"\([^"]*\)".*|\1|' | \ + while read file + do cache=${cache_prefix}_`generate_var $file` + if test -f $cache; then + : # We already ahve this cached + else + : >$cache + for path in $base `echo $INCLUDE | sed 's|-I||g'` + do dep="$path/$file" + if test -f "$dep"; then + echo " $dep \\" >>$cache + search_deps $dep >>$cache + break + fi + done + fi + cat $cache + done +} + +:>${output}.new +for src in $SOURCES +do echo "Generating dependencies for $src" + ext=`echo $src | sed 's|.*\.\(.*\)|\1|'` + if test x"$ext" = x"rc"; then + obj=`echo $src | sed "s|^.*/\([^ ]*\)\..*|\1.o|g"` + else + obj=`echo $src | sed "s|^.*/\([^ ]*\)\..*|\1.lo|g"` + fi + echo "\$(objects)/$obj: $src \\" >>${output}.new + search_deps $src | sort | uniq >>${output}.new + case $ext in + c) cat >>${output}.new <<__EOF__ + + \$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@ + +__EOF__ + ;; + cc) cat >>${output}.new <<__EOF__ + + \$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@ + +__EOF__ + ;; + m) cat >>${output}.new <<__EOF__ + + \$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@ + +__EOF__ + ;; + asm) cat >>${output}.new <<__EOF__ + + \$(LIBTOOL) --tag=CC --mode=compile \$(auxdir)/strip_fPIC.sh \$(NASM) $src -o \$@ + +__EOF__ + ;; + S) cat >>${output}.new <<__EOF__ + + \$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@ + +__EOF__ + ;; + rc) cat >>${output}.new <<__EOF__ + + \$(WINDRES) $src \$@ + +__EOF__ + ;; + *) echo "Unknown file extension: $ext";; + esac + echo "" >>${output}.new +done +mv ${output}.new ${output} +rm -f ${cache_prefix}* diff --git a/build-scripts/mkinstalldirs b/build-scripts/mkinstalldirs new file mode 100755 index 0000000..8ab885e --- /dev/null +++ b/build-scripts/mkinstalldirs @@ -0,0 +1,99 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +errstatus=0 +dirmode="" + +usage="\ +Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." + +# process command line arguments +while test $# -gt 0 ; do + case "${1}" in + -h | --help | --h* ) # -h for help + echo "${usage}" 1>&2; exit 0 ;; + -m ) # -m PERM arg + shift + test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } + dirmode="${1}" + shift ;; + -- ) shift; break ;; # stop option processing + -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option + * ) break ;; # first non-opt arg + esac +done + +for file +do + if test -d "$file"; then + shift + else + break + fi +done + +case $# in +0) exit 0 ;; +esac + +case $dirmode in +'') + if mkdir -p -- . 2>/dev/null; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + fi ;; +*) + if mkdir -m "$dirmode" -p -- . 2>/dev/null; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + fi ;; +esac + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + + lasterr="" + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# Local Variables: +# mode: shell-script +# sh-indentation: 3 +# End: +# mkinstalldirs ends here diff --git a/build-scripts/strip_fPIC.sh b/build-scripts/strip_fPIC.sh new file mode 100755 index 0000000..45d34ba --- /dev/null +++ b/build-scripts/strip_fPIC.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# +# libtool assumes that the compiler can handle the -fPIC flag +# This isn't always true (for example, nasm can't handle it) +command="" +while [ $# -gt 0 ]; do + case "$1" in + -fPIC) + # Ignore -fPIC option + ;; + -fno-common) + # Ignore -fPIC and -DPIC options + ;; + *) + command="$command $1" + ;; + esac + shift +done +echo $command +exec $command diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..a7e9b18 --- /dev/null +++ b/configure.in @@ -0,0 +1,2916 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(README) +AC_CONFIG_HEADER(include/SDL_config.h) +AC_GNU_SOURCE +AC_CONFIG_AUX_DIRS($srcdir/build-scripts) + +dnl Set various version strings - taken gratefully from the GTk sources +# +# Making releases: +# Edit include/SDL/SDL_version.h and change the version, then: +# SDL_MICRO_VERSION += 1; +# SDL_INTERFACE_AGE += 1; +# SDL_BINARY_AGE += 1; +# if any functions have been added, set SDL_INTERFACE_AGE to 0. +# if backwards compatibility has been broken, +# set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0. +# +SDL_MAJOR_VERSION=1 +SDL_MINOR_VERSION=2 +SDL_MICRO_VERSION=14 +SDL_INTERFACE_AGE=3 +SDL_BINARY_AGE=14 +SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION + +AC_SUBST(SDL_MAJOR_VERSION) +AC_SUBST(SDL_MINOR_VERSION) +AC_SUBST(SDL_MICRO_VERSION) +AC_SUBST(SDL_INTERFACE_AGE) +AC_SUBST(SDL_BINARY_AGE) +AC_SUBST(SDL_VERSION) + +# libtool versioning +LT_INIT([win32-dll]) + +LT_RELEASE=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION +LT_CURRENT=`expr $SDL_MICRO_VERSION - $SDL_INTERFACE_AGE` +LT_REVISION=$SDL_INTERFACE_AGE +LT_AGE=`expr $SDL_BINARY_AGE - $SDL_INTERFACE_AGE` +m4_pattern_allow([^LT_]) + +AC_SUBST(LT_RELEASE) +AC_SUBST(LT_CURRENT) +AC_SUBST(LT_REVISION) +AC_SUBST(LT_AGE) + +dnl Detect the canonical build and host environments +AC_CONFIG_AUX_DIR([build-scripts]) +dnl AC_CANONICAL_HOST +AC_C_BIGENDIAN +if test x$ac_cv_c_bigendian = xyes; then + AC_DEFINE(SDL_BYTEORDER, 4321) +else + AC_DEFINE(SDL_BYTEORDER, 1234) +fi + +dnl Check for tools +AC_PROG_LIBTOOL +AC_PROG_CC +AC_PROG_CXX +AC_PROG_INSTALL +AC_PROG_MAKE_SET +if test -z "$host_alias"; then + hostaliaswindres= +else + hostaliaswindres="$host_alias-windres" +fi +AC_CHECK_PROGS(WINDRES, [windres $hostaliaswindres $host_os-windres]) + +dnl Set up the compiler and linker flags +INCLUDE="-I$srcdir/include" +if test x$srcdir != x.; then + # Remove SDL_config.h from the source directory, since it's the + # default one, and we want to include the one that we generate. + if test -f $srcdir/include/SDL_config.h; then + rm $srcdir/include/SDL_config.h + fi + INCLUDE="-Iinclude $INCLUDE" +fi +case "$host" in + *-*-cygwin*) + # We build SDL on cygwin without the UNIX emulation layer + BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin" + BASE_LDFLAGS="-mno-cygwin" + ;; + *) + BASE_CFLAGS="-D_GNU_SOURCE=1" + BASE_LDFLAGS="" + ;; +esac +BUILD_CFLAGS="$CFLAGS $CPPFLAGS" +EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS" +BUILD_LDFLAGS="$LDFLAGS" +EXTRA_LDFLAGS="$BASE_LDFLAGS" +## These are common directories to find software packages +#for path in /usr/freeware /usr/pkg /usr/X11R6 /usr/local; do +# if test -d $path/include; then +# EXTRA_CFLAGS="$EXTRA_CFLAGS -I$path/include" +# fi +# if test -d $path/lib; then +# EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$path/lib" +# fi +#done +SDL_CFLAGS="$BASE_CFLAGS" +SDL_LIBS="-lSDL $BASE_LDFLAGS" +CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS" +CFLAGS="$CFLAGS $EXTRA_CFLAGS" +LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS" + +dnl set this to use on systems that use lib64 instead of lib +base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'` + +dnl Function to find a library in the compiler search path +find_lib() +{ + gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`] + gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`] + env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`] + if test "$cross_compiling" = yes; then + host_lib_path="" + else + host_lib_path="/usr/$base_libdir /usr/local/$base_libdir" + fi + for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do + lib=[`ls -- $path/$1 2>/dev/null | sort | sed 's/.*\/\(.*\)/\1/; q'`] + if test x$lib != x; then + echo $lib + return + fi + done +} + +dnl Check for compiler characteristics +AC_C_CONST +AC_C_INLINE +AC_C_VOLATILE + +dnl See whether we are allowed to use the system C library +AC_ARG_ENABLE(libc, +AC_HELP_STRING([--enable-libc], [Use the system C library [[default=yes]]]), + , enable_libc=yes) +if test x$enable_libc = xyes; then + AC_DEFINE(HAVE_LIBC) + + dnl Check for C library headers + AC_HEADER_STDC + AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h strings.h inttypes.h stdint.h ctype.h math.h iconv.h signal.h) + + dnl Check for typedefs, structures, etc. + AC_TYPE_SIZE_T + if test x$ac_cv_header_inttypes_h = xyes -o x$ac_cv_header_stdint_h = xyes; then + AC_CHECK_TYPE(int64_t) + if test x$ac_cv_type_int64_t = xyes; then + AC_DEFINE(SDL_HAS_64BIT_TYPE) + fi + have_inttypes=yes + fi + + dnl Checks for library functions. + case "$host" in + *-*-cygwin* | *-*-mingw32*) + ;; + *) + AC_FUNC_ALLOCA + ;; + esac + + AC_FUNC_MEMCMP + if test x$ac_cv_func_memcmp_working = xyes; then + AC_DEFINE(HAVE_MEMCMP) + fi + AC_FUNC_STRTOD + if test x$ac_cv_func_strtod = xyes; then + AC_DEFINE(HAVE_STRTOD) + fi + AC_CHECK_FUNC(mprotect, + AC_TRY_COMPILE([ + #include + #include + ],[ + ],[ + AC_DEFINE(HAVE_MPROTECT) + ]), + ) + AC_CHECK_FUNCS(malloc calloc realloc free getenv putenv unsetenv qsort abs bcopy memset memcpy memmove strlen strlcpy strlcat strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp sscanf snprintf vsnprintf iconv sigaction setjmp nanosleep) + + AC_CHECK_LIB(iconv, libiconv_open, [EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"]) + AC_CHECK_LIB(m, pow, [EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"]) +fi + +if test x$have_inttypes != xyes; then + AC_CHECK_SIZEOF(char, 1) + AC_CHECK_SIZEOF(short, 2) + AC_CHECK_SIZEOF(int, 4) + AC_CHECK_SIZEOF(long, 4) + AC_CHECK_SIZEOF(long long, 8) + if test x$ac_cv_sizeof_char = x1; then + AC_DEFINE(int8_t, signed char) + AC_DEFINE(uint8_t, unsigned char) + fi + if test x$ac_cv_sizeof_short = x2; then + AC_DEFINE(int16_t, signed short) + AC_DEFINE(uint16_t, unsigned short) + else + if test x$ac_cv_sizeof_int = x2; then + AC_DEFINE(int16_t, signed int) + AC_DEFINE(uint16_t, unsigned int) + fi + fi + if test x$ac_cv_sizeof_int = x4; then + AC_DEFINE(int32_t, signed int) + AC_DEFINE(uint32_t, unsigned int) + else + if test x$ac_cv_sizeof_long = x4; then + AC_DEFINE(int32_t, signed long) + AC_DEFINE(uint32_t, unsigned long) + fi + fi + if test x$ac_cv_sizeof_long = x8; then + AC_DEFINE(int64_t, signed long) + AC_DEFINE(uint64_t, unsigned long) + AC_DEFINE(SDL_HAS_64BIT_TYPE) + else + if test x$ac_cv_sizeof_long_long = x8; then + AC_DEFINE(int64_t, signed long long) + AC_DEFINE(uint64_t, unsigned long long) + AC_DEFINE(SDL_HAS_64BIT_TYPE) + fi + fi + AC_DEFINE(size_t, unsigned int) + AC_DEFINE(uintptr_t, unsigned long) +fi + +# Standard C sources +SOURCES="$SOURCES $srcdir/src/*.c" +SOURCES="$SOURCES $srcdir/src/audio/*.c" +SOURCES="$SOURCES $srcdir/src/cdrom/*.c" +SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c" +SOURCES="$SOURCES $srcdir/src/events/*.c" +SOURCES="$SOURCES $srcdir/src/file/*.c" +SOURCES="$SOURCES $srcdir/src/stdlib/*.c" +SOURCES="$SOURCES $srcdir/src/thread/*.c" +SOURCES="$SOURCES $srcdir/src/timer/*.c" +SOURCES="$SOURCES $srcdir/src/video/*.c" + +dnl Enable/disable various subsystems of the SDL library + +AC_ARG_ENABLE(audio, +AC_HELP_STRING([--enable-audio], [Enable the audio subsystem [[default=yes]]]), + , enable_audio=yes) +if test x$enable_audio != xyes; then + AC_DEFINE(SDL_AUDIO_DISABLED) +fi +AC_ARG_ENABLE(video, +AC_HELP_STRING([--enable-video], [Enable the video subsystem [[default=yes]]]), + , enable_video=yes) +if test x$enable_video != xyes; then + AC_DEFINE(SDL_VIDEO_DISABLED) +fi +AC_ARG_ENABLE(events, +AC_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]), + , enable_events=yes) +if test x$enable_events != xyes; then + AC_DEFINE(SDL_EVENTS_DISABLED) +fi +AC_ARG_ENABLE(joystick, +AC_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes]]]), + , enable_joystick=yes) +if test x$enable_joystick != xyes; then + AC_DEFINE(SDL_JOYSTICK_DISABLED) +else + SOURCES="$SOURCES $srcdir/src/joystick/*.c" +fi +AC_ARG_ENABLE(cdrom, +AC_HELP_STRING([--enable-cdrom], [Enable the cdrom subsystem [[default=yes]]]), + , enable_cdrom=yes) +if test x$enable_cdrom != xyes; then + AC_DEFINE(SDL_CDROM_DISABLED) +fi +AC_ARG_ENABLE(threads, +AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]), + , enable_threads=yes) +if test x$enable_threads != xyes; then + AC_DEFINE(SDL_THREADS_DISABLED) +fi +AC_ARG_ENABLE(timers, +AC_HELP_STRING([--enable-timers], [Enable the timer subsystem [[default=yes]]]), + , enable_timers=yes) +if test x$enable_timers != xyes; then + AC_DEFINE(SDL_TIMERS_DISABLED) +fi +AC_ARG_ENABLE(file, +AC_HELP_STRING([--enable-file], [Enable the file subsystem [[default=yes]]]), + , enable_file=yes) +if test x$enable_file != xyes; then + AC_DEFINE(SDL_FILE_DISABLED) +fi +AC_ARG_ENABLE(loadso, +AC_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [[default=yes]]]), + , enable_loadso=yes) +if test x$enable_loadso != xyes; then + AC_DEFINE(SDL_LOADSO_DISABLED) +fi +AC_ARG_ENABLE(cpuinfo, +AC_HELP_STRING([--enable-cpuinfo], [Enable the cpuinfo subsystem [[default=yes]]]), + , enable_cpuinfo=yes) +if test x$enable_cpuinfo != xyes; then + AC_DEFINE(SDL_CPUINFO_DISABLED) +fi +AC_ARG_ENABLE(assembly, +AC_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]), + , enable_assembly=yes) +if test x$enable_assembly = xyes; then + AC_DEFINE(SDL_ASSEMBLY_ROUTINES) +fi + +dnl See if the OSS audio interface is supported +CheckOSS() +{ + AC_ARG_ENABLE(oss, +AC_HELP_STRING([--enable-oss], [support the OSS audio API [[default=yes]]]), + , enable_oss=yes) + if test x$enable_audio = xyes -a x$enable_oss = xyes; then + AC_MSG_CHECKING(for OSS audio support) + have_oss=no + if test x$have_oss != xyes; then + AC_TRY_COMPILE([ + #include + ],[ + int arg = SNDCTL_DSP_SETFRAGMENT; + ],[ + have_oss=yes + ]) + fi + if test x$have_oss != xyes; then + AC_TRY_COMPILE([ + #include + ],[ + int arg = SNDCTL_DSP_SETFRAGMENT; + ],[ + have_oss=yes + AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H) + ]) + fi + AC_MSG_RESULT($have_oss) + if test x$have_oss = xyes; then + AC_DEFINE(SDL_AUDIO_DRIVER_OSS) + SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c" + SOURCES="$SOURCES $srcdir/src/audio/dma/*.c" + have_audio=yes + + # We may need to link with ossaudio emulation library + case "$host" in + *-*-openbsd*|*-*-netbsd*) + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";; + esac + fi + fi +} + +dnl See if the ALSA audio interface is supported +CheckALSA() +{ + AC_ARG_ENABLE(alsa, +AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]), + , enable_alsa=yes) + if test x$enable_audio = xyes -a x$enable_alsa = xyes; then + AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no) + # Restore all flags from before the ALSA detection runs + CFLAGS="$alsa_save_CFLAGS" + LDFLAGS="$alsa_save_LDFLAGS" + LIBS="$alsa_save_LIBS" + if test x$have_alsa = xyes; then + AC_ARG_ENABLE(alsa-shared, +AC_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[default=yes]]]), + , enable_alsa_shared=yes) + alsa_lib=[`find_lib "libasound.so.*" "$ALSA_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] + + AC_DEFINE(SDL_AUDIO_DRIVER_ALSA) + SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS $ALSA_CFLAGS" + if test x$have_loadso != xyes && \ + test x$enable_alsa_shared = xyes; then + AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ALSA loading]) + fi + if test x$have_loadso = xyes && \ + test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then + echo "-- dynamic libasound -> $alsa_lib" + AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib") + else + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS" + fi + have_audio=yes + fi + fi +} + +dnl Check whether we want to use IRIX 6.5+ native audio or not +CheckDMEDIA() +{ + if test x$enable_audio = xyes; then + AC_MSG_CHECKING(for dmedia audio support) + have_dmedia=no + AC_TRY_COMPILE([ + #include + ],[ + ALport audio_port; + ],[ + have_dmedia=yes + ]) + AC_MSG_RESULT($have_dmedia) + # Set up files for the audio library + if test x$have_dmedia = xyes; then + AC_DEFINE(SDL_AUDIO_DRIVER_DMEDIA) + SOURCES="$SOURCES $srcdir/src/audio/dmedia/*.c" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -laudio" + have_audio=yes + fi + fi +} + +dnl Check whether we want to use Tru64 UNIX native audio or not +CheckMME() +{ + dnl Make sure we are running on an Tru64 UNIX + case $ARCH in + osf) + ;; + *) + return + ;; + esac + if test x$enable_audio = xyes; then + AC_MSG_CHECKING(for MME audio support) + MME_CFLAGS="-I/usr/include/mme" + MME_LIBS="-lmme" + have_mme=no + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $MME_CFLAGS" + AC_TRY_COMPILE([ + #include + ],[ + HWAVEOUT sound; + ],[ + have_mme=yes + ]) + CFLAGS="$save_CFLAGS" + AC_MSG_RESULT($have_mme) + # Set up files for the audio library + if test x$have_mme = xyes; then + AC_DEFINE(SDL_AUDIO_DRIVER_MMEAUDIO) + SOURCES="$SOURCES $srcdir/src/audio/mme/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS $MME_CFLAGS" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MME_LIBS" + have_audio=yes + fi + fi +} + +dnl Find the ESD includes and libraries +CheckESD() +{ + AC_ARG_ENABLE(esd, +AC_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [[default=yes]]]), + , enable_esd=yes) + if test x$enable_audio = xyes -a x$enable_esd = xyes; then + AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no) + if test x$have_esd = xyes; then + AC_ARG_ENABLE(esd-shared, +AC_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [[default=yes]]]), + , enable_esd_shared=yes) + esd_lib=[`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] + + AC_DEFINE(SDL_AUDIO_DRIVER_ESD) + SOURCES="$SOURCES $srcdir/src/audio/esd/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS" + if test x$have_loadso != xyes && \ + test x$enable_esd_shared = xyes; then + AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ESD loading]) + fi + if test x$have_loadso = xyes && \ + test x$enable_esd_shared = xyes && test x$esd_lib != x; then + echo "-- dynamic libesd -> $esd_lib" + AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib") + else + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS" + fi + have_audio=yes + fi + fi +} + +dnl Find PulseAudio +CheckPulseAudio() +{ + AC_ARG_ENABLE(pulseaudio, +AC_HELP_STRING([--enable-pulseaudio], [use PulseAudio [[default=yes]]]), + , enable_pulseaudio=yes) + if test x$enable_audio = xyes -a x$enable_pulseaudio = xyes; then + audio_pulse=no + + PULSE_REQUIRED_VERSION=0.9 + + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + AC_MSG_CHECKING(for PulseAudio $PULSE_REQUIRED_VERSION support) + if test x$PKG_CONFIG != xno; then + if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $PULSE_REQUIRED_VERSION libpulse-simple; then + PULSE_CFLAGS=`$PKG_CONFIG --cflags libpulse-simple` + PULSE_LIBS=`$PKG_CONFIG --libs libpulse-simple` + audio_pulse=yes + fi + fi + AC_MSG_RESULT($audio_pulse) + + if test x$audio_pulse = xyes; then + AC_ARG_ENABLE(pulseaudio-shared, +AC_HELP_STRING([--enable-pulseaudio-shared], [dynamically load PulseAudio support [[default=yes]]]), + , enable_pulseaudio_shared=yes) + pulse_lib=[`find_lib "libpulse-simple.so.*" "$PULSE_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] + + AC_DEFINE(SDL_AUDIO_DRIVER_PULSE) + SOURCES="$SOURCES $srcdir/src/audio/pulse/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS $PULSE_CFLAGS" + if test x$have_loadso != xyes && \ + test x$enable_pulseaudio_shared = xyes; then + AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic PulseAudio loading]) + fi + if test x$have_loadso = xyes && \ + test x$enable_pulseaudio_shared = xyes && test x$pulse_lib != x; then + echo "-- dynamic libpulse-simple -> $pulse_lib" + AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSE_DYNAMIC, "$pulse_lib") + else + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSE_LIBS" + fi + have_audio=yes + fi + fi +} + +CheckARTSC() +{ + AC_ARG_ENABLE(arts, +AC_HELP_STRING([--enable-arts], [support the Analog Real Time Synthesizer [[default=yes]]]), + , enable_arts=yes) + if test x$enable_audio = xyes -a x$enable_arts = xyes; then + AC_PATH_PROG(ARTSCONFIG, artsc-config) + if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then + : # arts isn't installed + else + ARTS_CFLAGS=`$ARTSCONFIG --cflags` + ARTS_LIBS=`$ARTSCONFIG --libs` + AC_MSG_CHECKING(for aRts development environment) + audio_arts=no + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $ARTS_CFLAGS" + AC_TRY_COMPILE([ + #include + ],[ + arts_stream_t stream; + ],[ + audio_arts=yes + ]) + CFLAGS="$save_CFLAGS" + AC_MSG_RESULT($audio_arts) + if test x$audio_arts = xyes; then + AC_ARG_ENABLE(arts-shared, +AC_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [[default=yes]]]), + , enable_arts_shared=yes) + arts_lib=[`find_lib "libartsc.so.*" "$ARTS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] + + AC_DEFINE(SDL_AUDIO_DRIVER_ARTS) + SOURCES="$SOURCES $srcdir/src/audio/arts/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS" + if test x$have_loadso != xyes && \ + test x$enable_arts_shared = xyes; then + AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ARTS loading]) + fi + if test x$have_loadso = xyes && \ + test x$enable_arts_shared = xyes && test x$arts_lib != x; then + echo "-- dynamic libartsc -> $arts_lib" + AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib") + else + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS" + fi + have_audio=yes + fi + fi + fi +} + +dnl See if the NAS audio interface is supported +CheckNAS() +{ + AC_ARG_ENABLE(nas, +AC_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]), + , enable_nas=yes) + if test x$enable_audio = xyes -a x$enable_nas = xyes; then + AC_CHECK_HEADER(audio/audiolib.h, have_nas_hdr=yes) + AC_CHECK_LIB(audio, AuOpenServer, have_nas_lib=yes) + + AC_MSG_CHECKING(for NAS audio support) + have_nas=no + + if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then + have_nas=yes + NAS_LIBS="-laudio" + + elif test -r /usr/X11R6/include/audio/audiolib.h; then + have_nas=yes + NAS_CFLAGS="-I/usr/X11R6/include/" + NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt" + + dnl On IRIX, the NAS includes are in a different directory, + dnl and libnas must be explicitly linked in + + elif test -r /usr/freeware/include/nas/audiolib.h; then + have_nas=yes + NAS_LIBS="-lnas -lXt" + fi + + AC_MSG_RESULT($have_nas) + + if test x$have_nas = xyes; then + AC_ARG_ENABLE(nas-shared, +AC_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [[default=yes]]]), + , enable_nas_shared=yes) + nas_lib=[`find_lib "libaudio.so.*" "$NAS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] + + if test x$have_loadso != xyes && \ + test x$enable_nas_shared = xyes; then + AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic NAS loading]) + fi + if test x$have_loadso = xyes && \ + test x$enable_nas_shared = xyes && test x$nas_lib != x; then + echo "-- dynamic libaudio -> $nas_lib" + AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib") + else + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS" + fi + + AC_DEFINE(SDL_AUDIO_DRIVER_NAS) + SOURCES="$SOURCES $srcdir/src/audio/nas/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS" + have_audio=yes + fi + fi +} + +dnl rcg07142001 See if the user wants the disk writer audio driver... +CheckDiskAudio() +{ + AC_ARG_ENABLE(diskaudio, +AC_HELP_STRING([--enable-diskaudio], [support the disk writer audio driver [[default=yes]]]), + , enable_diskaudio=yes) + if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then + AC_DEFINE(SDL_AUDIO_DRIVER_DISK) + SOURCES="$SOURCES $srcdir/src/audio/disk/*.c" + fi +} + +dnl rcg03142006 See if the user wants the dummy audio driver... +CheckDummyAudio() +{ + AC_ARG_ENABLE(dummyaudio, +AC_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default=yes]]]), + , enable_dummyaudio=yes) + if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then + AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY) + SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c" + fi +} + +dnl Set up the Atari Audio driver +CheckAtariAudio() +{ + AC_ARG_ENABLE(mintaudio, +AC_HELP_STRING([--enable-mintaudio], [support Atari audio driver [[default=yes]]]), + , enable_mintaudio=yes) + if test x$enable_audio = xyes -a x$enable_mintaudio = xyes; then + mintaudio=no + AC_CHECK_HEADER(mint/falcon.h, have_mint_falcon_hdr=yes) + if test x$have_mint_falcon_hdr = xyes; then + mintaudio=yes + AC_DEFINE(SDL_AUDIO_DRIVER_MINT) + SOURCES="$SOURCES $srcdir/src/audio/mint/*.c" + SOURCES="$SOURCES $srcdir/src/audio/mint/*.S" + have_audio=yes + fi + fi +} + +dnl See if we can use x86 assembly blitters +# NASM is available from: http://nasm.sourceforge.net +CheckNASM() +{ + dnl Make sure we are running on an x86 platform + case $host in + i?86*) + ;; + *) + # Nope, bail early. + return + ;; + esac + + dnl Mac OS X might report itself as "i386" but generate x86_64 code. + dnl So see what size we think a pointer is, and bail if not 32-bit. + AC_CHECK_SIZEOF([void *], 4) + if test x$ac_cv_sizeof_void_p != x4; then + return + fi + + dnl Check for NASM (for assembly blit routines) + AC_ARG_ENABLE(nasm, +AC_HELP_STRING([--enable-nasm], [use nasm assembly blitters on x86 [[default=yes]]]), + , enable_nasm=yes) + if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_nasm = xyes; then + CompileNASM() + { + # Usage: CompileNASM + AC_MSG_CHECKING(to see if $NASM supports $1) + if $NASM $NASMFLAGS $1 -o $1.o >&AS_MESSAGE_LOG_FD 2>&1; then + CompileNASM_ret="yes" + else + CompileNASM_ret="no" + fi + rm -f $1 $1.o + AC_MSG_RESULT($CompileNASM_ret) + test "$CompileNASM_ret" = "yes" + } + + if test x"$NASMFLAGS" = x; then + case $ARCH in + win32) + NASMFLAGS="-f win32" + ;; + openbsd) + NASMFLAGS="-f aoutb" + ;; + macosx) + NASMFLAGS="-f macho" + ;; + *) + NASMFLAGS="-f elf" + ;; + esac + fi + + AC_PATH_PROG(NASM, yasm) + echo "%ifidn __OUTPUT_FORMAT__,elf" > unquoted-sections + echo "section .note.GNU-stack noalloc noexec nowrite progbits" >> unquoted-sections + echo "%endif" >> unquoted-sections + CompileNASM unquoted-sections || NASM="" + + if test "x$NASM" = x -o "x$NASM" = x'"$NASM"'; then + $as_unset ac_cv_path_NASM + AC_PATH_PROG(NASM, nasm) + fi + if test "x$NASM" != x -a "x$NASM" != x'"$NASM"'; then + AC_DEFINE(SDL_HERMES_BLITTERS) + SOURCES="$SOURCES $srcdir/src/hermes/*.asm" + NASMFLAGS="$NASMFLAGS -I $srcdir/src/hermes/" + + dnl See if hidden visibility is supported + echo "GLOBAL _bar:function hidden" > symbol-visibility + echo "_bar:" >> symbol-visibility + CompileNASM symbol-visibility && NASMFLAGS="$NASMFLAGS -DHIDDEN_VISIBILITY" + + AC_SUBST(NASM) + AC_SUBST(NASMFLAGS) + + case "$host" in + # this line is needed for QNX, because it's not defined the __ELF__ + *-*-qnx*) + EXTRA_CFLAGS="$EXTRA_CFLAGS -D__ELF__";; + *-*-solaris*) + EXTRA_CFLAGS="$EXTRA_CFLAGS -D__ELF__";; + esac + fi + fi +} + +dnl Check for altivec instruction support using gas syntax +CheckAltivec() +{ + AC_ARG_ENABLE(altivec, +AC_HELP_STRING([--enable-altivec], [use altivec assembly blitters on PPC [[default=yes]]]), + , enable_altivec=yes) + if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_altivec = xyes; then + save_CFLAGS="$CFLAGS" + have_gcc_altivec=no + have_altivec_h_hdr=no + altivec_CFLAGS="-maltivec" + CFLAGS="$save_CFLAGS $altivec_CFLAGS" + + AC_MSG_CHECKING(for Altivec with GCC altivec.h and -maltivec option) + AC_TRY_COMPILE([ + #include + vector unsigned int vzero() { + return vec_splat_u32(0); + } + ],[ + ],[ + have_gcc_altivec=yes + have_altivec_h_hdr=yes + ]) + AC_MSG_RESULT($have_gcc_altivec) + + if test x$have_gcc_altivec = xno; then + AC_MSG_CHECKING(for Altivec with GCC -maltivec option) + AC_TRY_COMPILE([ + vector unsigned int vzero() { + return vec_splat_u32(0); + } + ],[ + ],[ + have_gcc_altivec=yes + ]) + AC_MSG_RESULT($have_gcc_altivec) + fi + + if test x$have_gcc_altivec = xno; then + AC_MSG_CHECKING(for Altivec with GCC altivec.h and -faltivec option) + altivec_CFLAGS="-faltivec" + CFLAGS="$save_CFLAGS $altivec_CFLAGS" + AC_TRY_COMPILE([ + #include + vector unsigned int vzero() { + return vec_splat_u32(0); + } + ],[ + ],[ + have_gcc_altivec=yes + have_altivec_h_hdr=yes + ]) + AC_MSG_RESULT($have_gcc_altivec) + fi + + if test x$have_gcc_altivec = xno; then + AC_MSG_CHECKING(for Altivec with GCC -faltivec option) + AC_TRY_COMPILE([ + vector unsigned int vzero() { + return vec_splat_u32(0); + } + ],[ + ],[ + have_gcc_altivec=yes + ]) + AC_MSG_RESULT($have_gcc_altivec) + fi + CFLAGS="$save_CFLAGS" + + if test x$have_gcc_altivec = xyes; then + AC_DEFINE(SDL_ALTIVEC_BLITTERS) + if test x$have_altivec_h_hdr = xyes; then + AC_DEFINE(HAVE_ALTIVEC_H) + fi + EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS" + fi + fi +} + +dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually). +dnl Details of this flag are here: http://gcc.gnu.org/wiki/Visibility +CheckVisibilityHidden() +{ + AC_MSG_CHECKING(for GCC -fvisibility=hidden option) + have_gcc_fvisibility=no + + visibility_CFLAGS="-fvisibility=hidden" + save_CFLAGS="$CFLAGS" + CFLAGS="$save_CFLAGS $visibility_CFLAGS -Werror" + AC_TRY_COMPILE([ + #if !defined(__GNUC__) || __GNUC__ < 4 + #error SDL only uses visibility attributes in GCC 4 or newer + #endif + ],[ + ],[ + have_gcc_fvisibility=yes + ]) + AC_MSG_RESULT($have_gcc_fvisibility) + CFLAGS="$save_CFLAGS" + + if test x$have_gcc_fvisibility = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS" + fi +} + + +dnl Do the iPod thing +CheckIPod() +{ + AC_ARG_ENABLE(ipod, +AC_HELP_STRING([--enable-ipod], [configure SDL to work with iPodLinux [[default=no]]]), + , enable_ipod=no) + + if test x$enable_ipod = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -DIPOD" + AC_DEFINE(SDL_VIDEO_DRIVER_IPOD) + SOURCES="$SOURCES $srcdir/src/video/ipod/*.c" + fi +} + +dnl Find the nanox include and library directories +CheckNANOX() +{ + AC_ARG_ENABLE(video-nanox, + AC_HELP_STRING([--enable-video-nanox], [use nanox video driver [[default=no]]]), + , enable_video_nanox=no) + + if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then + AC_ARG_ENABLE(nanox-debug, + AC_HELP_STRING([--enable-nanox-debug], [print debug messages [[default=no]]]), + , enable_nanox_debug=no) + if test x$enable_nanox_debug = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -DENABLE_NANOX_DEBUG" + fi + + AC_ARG_ENABLE(nanox-share-memory, + AC_HELP_STRING([--enable-nanox-share-memory], [use share memory [[default=no]]]), + , enable_nanox_share_memory=no) + if test x$enable_nanox_share_memory = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -DNANOX_SHARE_MEMORY" + fi + + AC_ARG_ENABLE(nanox_direct_fb, + AC_HELP_STRING([--enable-nanox-direct-fb], [use direct framebuffer access [[default=no]]]), + , enable_nanox_direct_fb=no) + if test x$enable_nanox_direct_fb = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -DENABLE_NANOX_DIRECT_FB" + fi + + AC_DEFINE(SDL_VIDEO_DRIVER_NANOX) + SOURCES="$SOURCES $srcdir/src/video/nanox/*.c" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lnano-X" + have_video=yes + fi +} + +dnl Find the X11 include and library directories +CheckX11() +{ + AC_ARG_ENABLE(video-x11, +AC_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]), + , enable_video_x11=yes) + if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then + case "$host" in + *-*-darwin*) + # This isn't necessary for X11, but fixes GLX detection + if test "x$x_includes" = xNONE && test "x$x_libraries" = xNONE; then + x_includes="/usr/X11R6/include" + x_libraries="/usr/X11R6/lib" + fi + ;; + esac + AC_PATH_X + AC_PATH_XTRA + if test x$have_x = xyes; then + # Only allow dynamically loaded X11 if the X11 function pointers + # will not end up in the global namespace, which causes problems + # with other libraries calling X11 functions. + x11_symbols_private=$have_gcc_fvisibility + + AC_ARG_ENABLE(x11-shared, +AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=maybe]]]), + , enable_x11_shared=maybe) + + case "$host" in + *-*-darwin*) # Latest Mac OS X actually ships with Xrandr/Xrender libs... + x11_symbols_private=yes + x11_lib='/usr/X11R6/lib/libX11.6.dylib' + x11ext_lib='/usr/X11R6/lib/libXext.6.dylib' + xrender_lib='/usr/X11R6/lib/libXrender.1.dylib' + xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib' + ;; + *-*-osf*) + x11_lib='libX11.so' + x11ext_lib='libXext.so' + ;; + *-*-irix*) # IRIX 6.5 requires that we use /usr/lib32 + x11_lib='libX11.so' + x11ext_lib='libXext.so' + ;; + *) + x11_lib=[`find_lib "libX11.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`] + x11ext_lib=[`find_lib "libXext.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`] + xrender_lib=[`find_lib "libXrender.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`] + xrandr_lib=[`find_lib "libXrandr.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`] + ;; + esac + + X_CFLAGS="$X_CFLAGS -DXTHREADS" + if test x$ac_cv_func_shmat != xyes; then + X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY" + fi + CFLAGS="$CFLAGS $X_CFLAGS" + LDFLAGS="$LDFLAGS $X_LIBS" + + AC_DEFINE(SDL_VIDEO_DRIVER_X11) + SOURCES="$SOURCES $srcdir/src/video/x11/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS" + + if test x$enable_x11_shared = xmaybe; then + enable_x11_shared=$x11_symbols_private + fi + if test x$have_loadso != xyes && \ + test x$enable_x11_shared = xyes; then + AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic X11 loading]) + enable_x11_shared=no + fi + if test x$x11_symbols_private != xyes && \ + test x$enable_x11_shared = xyes; then + AC_MSG_WARN([You must have gcc4 (-fvisibility=hidden) for dynamic X11 loading]) + enable_x11_shared=no + fi + + if test x$have_loadso = xyes && \ + test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then + echo "-- dynamic libX11 -> $x11_lib" + echo "-- dynamic libX11ext -> $x11ext_lib" + AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib") + AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib") + else + enable_x11_shared=no + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext" + fi + have_video=yes + + AC_ARG_ENABLE(dga, +AC_HELP_STRING([--enable-dga], [allow use of X11 DGA code [[default=yes]]]), + , enable_dga=yes) + if test x$enable_dga = xyes; then + SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86dga/*.c" + fi + AC_ARG_ENABLE(video-dga, +AC_HELP_STRING([--enable-video-dga], [use DGA 2.0 video driver [[default=yes]]]), + , enable_video_dga=yes) + if test x$enable_dga = xyes -a x$enable_video_dga = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_DGA) + SOURCES="$SOURCES $srcdir/src/video/dga/*.c" + fi + AC_ARG_ENABLE(video-x11-dgamouse, +AC_HELP_STRING([--enable-video-x11-dgamouse], [use X11 DGA for mouse events [[default=yes]]]), + , enable_video_x11_dgamouse=yes) + if test x$enable_dga = xyes -a x$enable_video_x11_dgamouse = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_X11_DGAMOUSE) + fi + AC_ARG_ENABLE(video-x11-vm, +AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]), + , enable_video_x11_vm=yes) + if test x$enable_video_x11_vm = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_X11_VIDMODE) + SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86vm/*.c" + fi + AC_ARG_ENABLE(video-x11-xv, +AC_HELP_STRING([--enable-video-x11-xv], [use X11 XvImage extension for video [[default=yes]]]), + , enable_video_x11_xv=yes) + if test x$enable_video_x11_xv = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_X11_XV) + SOURCES="$SOURCES $srcdir/src/video/Xext/Xv/*.c" + fi + AC_ARG_ENABLE(video-x11-xinerama, +AC_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [[default=yes]]]), + , enable_video_x11_xinerama=yes) + if test x$enable_video_x11_xinerama = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA) + SOURCES="$SOURCES $srcdir/src/video/Xext/Xinerama/*.c" + fi + AC_ARG_ENABLE(video-x11-xme, +AC_HELP_STRING([--enable-video-x11-xme], [enable Xi Graphics XME for fullscreen [[default=yes]]]), + , enable_video_x11_xme=yes) + if test x$enable_video_x11_xme = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_X11_XME) + SOURCES="$SOURCES $srcdir/src/video/Xext/XME/*.c" + fi + AC_ARG_ENABLE(video-x11-xrandr, +AC_HELP_STRING([--enable-video-x11-xrandr], [enable X11 Xrandr extension for fullscreen [[default=yes]]]), + , enable_video_x11_xrandr=yes) + if test x$enable_video_x11_xrandr = xyes; then + definitely_enable_video_x11_xrandr=no + AC_CHECK_HEADER(X11/extensions/Xrandr.h, + have_xrandr_h_hdr=yes, + have_xrandr_h_hdr=no, + [#include + ]) + if test x$have_xrandr_h_hdr = xyes; then + if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then + echo "-- dynamic libXrender -> $xrender_lib" + echo "-- dynamic libXrandr -> $xrandr_lib" + AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER, "$xrender_lib") + AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib") + definitely_enable_video_x11_xrandr=yes + else + AC_CHECK_LIB(Xrender, XRenderQueryExtension, have_xrender_lib=yes) + AC_CHECK_LIB(Xrandr, XRRQueryExtension, have_xrandr_lib=yes) + if test x$have_xrender_lib = xyes && test x$have_xrandr_lib = xyes ; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr -lXrender" + definitely_enable_video_x11_xrandr=yes + fi + fi + fi + fi + if test x$definitely_enable_video_x11_xrandr = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR) + fi + fi + fi +} + +dnl Check for QNX photon video driver +CheckPHOTON() +{ + AC_ARG_ENABLE(video-photon, +AC_HELP_STRING([--enable-video-photon], [use QNX Photon video driver [[default=yes]]]), + , enable_video_photon=yes) + if test x$enable_video = xyes -a x$enable_video_photon = xyes; then + AC_MSG_CHECKING(for QNX Photon support) + video_photon=no + AC_TRY_COMPILE([ + #include + #include + #include + #include + ],[ + PgDisplaySettings_t *visual; + ],[ + video_photon=yes + ]) + AC_MSG_RESULT($video_photon) + if test x$video_photon = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_PHOTON) + SOURCES="$SOURCES $srcdir/src/video/photon/*.c" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lph" + have_video=yes + + CheckOpenGLQNX + fi + fi +} + +dnl Set up the BWindow video driver if enabled +CheckBWINDOW() +{ + if test x$enable_video = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_BWINDOW) + SOURCES="$SOURCES $srcdir/src/video/bwindow/*.cc" + have_video=yes + fi +} + +dnl Set up the Carbon/QuickDraw video driver for Mac OS X (but not Darwin) +CheckCARBON() +{ + AC_ARG_ENABLE(video-carbon, +AC_HELP_STRING([--enable-video-carbon], [use Carbon/QuickDraw video driver [[default=no]]]), + , enable_video_carbon=no) + if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then + AC_MSG_CHECKING(for Carbon framework) + have_carbon=no + AC_TRY_COMPILE([ + #include + ],[ + ],[ + have_carbon=yes + ]) + AC_MSG_RESULT($have_carbon) + if test x$have_carbon = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_TOOLBOX) + SOURCES="$SOURCES $srcdir/src/video/maccommon/*.c" + SOURCES="$SOURCES $srcdir/src/video/macrom/*.c" + have_video=yes + fi + fi +} + +dnl Set up the Cocoa/Quartz video driver for Mac OS X (but not Darwin) +CheckCOCOA() +{ + AC_ARG_ENABLE(video-cocoa, +AC_HELP_STRING([--enable-video-cocoa], [use Cocoa/Quartz video driver [[default=yes]]]), + , enable_video_cocoa=yes) + if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then + save_CFLAGS="$CFLAGS" + dnl work around that we don't have Objective-C support in autoconf + CFLAGS="$CFLAGS -x objective-c" + AC_MSG_CHECKING(for Cocoa framework) + have_cocoa=no + AC_TRY_COMPILE([ + #import + ],[ + ],[ + have_cocoa=yes + ]) + AC_MSG_RESULT($have_cocoa) + CFLAGS="$save_CFLAGS" + if test x$have_cocoa = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_QUARTZ) + SOURCES="$SOURCES $srcdir/src/video/quartz/*.m" + have_video=yes + fi + fi +} + +dnl Find the framebuffer console includes +CheckFBCON() +{ + AC_ARG_ENABLE(video-fbcon, +AC_HELP_STRING([--enable-video-fbcon], [use framebuffer console video driver [[default=yes]]]), + , enable_video_fbcon=yes) + if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then + AC_MSG_CHECKING(for framebuffer console support) + video_fbcon=no + AC_TRY_COMPILE([ + #include + #include + #include + ],[ + ],[ + video_fbcon=yes + ]) + AC_MSG_RESULT($video_fbcon) + if test x$video_fbcon = xyes; then + AC_CHECK_FUNCS(getpagesize) + AC_DEFINE(SDL_VIDEO_DRIVER_FBCON) + SOURCES="$SOURCES $srcdir/src/video/fbcon/*.c" + have_video=yes + fi + fi +} + +dnl Find DirectFB +CheckDirectFB() +{ + AC_ARG_ENABLE(video-directfb, +AC_HELP_STRING([--enable-video-directfb], [use DirectFB video driver [[default=yes]]]), + , enable_video_directfb=yes) + if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then + video_directfb=no + + DIRECTFB_REQUIRED_VERSION=0.9.15 + + AC_PATH_PROG(DIRECTFBCONFIG, directfb-config, no) + if test x$DIRECTFBCONFIG = xno; then + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + if test x$PKG_CONFIG != xno; then + if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb; then + DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb` + DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb` + video_directfb=yes + fi + fi + else + set -- `echo $DIRECTFB_REQUIRED_VERSION | sed 's/\./ /g'` + NEED_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3` + set -- `directfb-config --version | sed 's/\./ /g'` + HAVE_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3` + if test $HAVE_VERSION -ge $NEED_VERSION; then + DIRECTFB_CFLAGS=`$DIRECTFBCONFIG --cflags` + DIRECTFB_LIBS=`$DIRECTFBCONFIG --libs` + video_directfb=yes + fi + fi + if test x$video_directfb = xyes; then + # SuSE 11.1 installs directfb-config without directfb-devel + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $DIRECTFB_CFLAGS" + AC_CHECK_HEADER(directfb.h, have_directfb_hdr=yes, have_directfb_hdr=no) + CFLAGS="$save_CFLAGS" + video_directfb=$have_directfb_hdr + fi + AC_MSG_CHECKING(for DirectFB $DIRECTFB_REQUIRED_VERSION support) + AC_MSG_RESULT($video_directfb) + + if test x$video_directfb = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB) + SOURCES="$SOURCES $srcdir/src/video/directfb/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS" + have_video=yes + fi + fi +} + +dnl See if we're running on PlayStation 2 hardware +CheckPS2GS() +{ + AC_ARG_ENABLE(video-ps2gs, +AC_HELP_STRING([--enable-video-ps2gs], [use PlayStation 2 GS video driver [[default=yes]]]), + , enable_video_ps2gs=yes) + if test x$enable_video = xyes -a x$enable_video_ps2gs = xyes; then + AC_MSG_CHECKING(for PlayStation 2 GS support) + video_ps2gs=no + AC_TRY_COMPILE([ + #include + #include + ],[ + ],[ + video_ps2gs=yes + ]) + AC_MSG_RESULT($video_ps2gs) + if test x$video_ps2gs = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_PS2GS) + SOURCES="$SOURCES $srcdir/src/video/ps2gs/*.c" + have_video=yes + fi + fi +} + +dnl See if we're running on PlayStation 3 Cell hardware +CheckPS3() +{ + AC_ARG_ENABLE(video-ps3, + AC_HELP_STRING([--enable-video-ps3], [use PlayStation 3 Cell driver [[default=yes]]]), + , enable_video_ps3=yes) + if test x$enable_video = xyes -a x$enable_video_ps3 = xyes; then + AC_MSG_CHECKING(for PlayStation 3 Cell support) + video_ps3=no + AC_TRY_COMPILE([ + #include + #include + ],[ + ],[ + video_ps3=yes + ]) + AC_MSG_RESULT($video_ps3) + if test x$video_ps3 = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_PS3) + SOURCES="$SOURCES $srcdir/src/video/ps3/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS -I/opt/cell/sdk/usr/include" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lbilin_scaler_spu -lfb_writer_spu -lyuv2rgb_spu -L/opt/cell/sdk/usr/lib -lspe2" + have_video=yes + fi + fi +} + +dnl Find the GGI includes +CheckGGI() +{ + AC_ARG_ENABLE(video-ggi, +AC_HELP_STRING([--enable-video-ggi], [use GGI video driver [[default=no]]]), + , enable_video_ggi=no) + if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then + AC_MSG_CHECKING(for GGI support) + video_ggi=no + AC_TRY_COMPILE([ + #include + #include + ],[ + ],[ + video_ggi=yes + ]) + AC_MSG_RESULT($video_ggi) + if test x$video_ggi = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_GGI) + SOURCES="$SOURCES $srcdir/src/video/ggi/*.c" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lggi -lgii -lgg" + have_video=yes + fi + fi +} + +dnl Find the SVGAlib includes and libraries +CheckSVGA() +{ + AC_ARG_ENABLE(video-svga, +AC_HELP_STRING([--enable-video-svga], [use SVGAlib video driver [[default=yes]]]), + , enable_video_svga=yes) + if test x$enable_video = xyes -a x$enable_video_svga = xyes; then + AC_MSG_CHECKING(for SVGAlib (1.4.0+) support) + video_svga=no + AC_TRY_COMPILE([ + #include + #include + #include + ],[ + if ( SCANCODE_RIGHTWIN && SCANCODE_LEFTWIN ) { + exit(0); + } + ],[ + video_svga=yes + ]) + AC_MSG_RESULT($video_svga) + if test x$video_svga = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_SVGALIB) + SOURCES="$SOURCES $srcdir/src/video/svga/*.c" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvga" + have_video=yes + fi + fi +} + +dnl Find the VGL includes and libraries +CheckVGL() +{ + AC_ARG_ENABLE(video-vgl, +AC_HELP_STRING([--enable-video-vgl], [use VGL video driver [[default=yes]]]), + , enable_video_vgl=yes) + if test x$enable_video = xyes -a x$enable_video_vgl = xyes; then + AC_MSG_CHECKING(for libVGL support) + video_vgl=no + AC_TRY_COMPILE([ + #include + #include + #include + #include + ],[ + VGLBitmap bitmap; + bitmap.Type = VIDBUF32; + bitmap.PixelBytes = 4; + exit(bitmap.Bitmap); + ],[ + video_vgl=yes + ]) + AC_MSG_RESULT($video_vgl) + if test x$video_vgl = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_VGL) + SOURCES="$SOURCES $srcdir/src/video/vgl/*.c" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvgl" + have_video=yes + fi + fi +} + +dnl Set up the wscons video driver if enabled +CheckWscons() +{ + AC_ARG_ENABLE(video-wscons, +AC_HELP_STRING([--enable-video-wscons], [use wscons video driver [[default=yes]]]), + , enable_video_wscons=yes) + if test x$enable_video = xyes -a x$enable_video_wscons = xyes; then + AC_MSG_CHECKING(for wscons support) + video_wscons=no + AC_TRY_COMPILE([ + #include + #include + #include + ],[ + int wsmode = WSDISPLAYIO_MODE_DUMBFB; + ],[ + video_wscons=yes + ]) + AC_MSG_RESULT($video_wscons) + if test x$video_wscons = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_WSCONS) + SOURCES="$SOURCES $srcdir/src/video/wscons/*.c" + have_video=yes + fi + fi +} + + +dnl Find the AAlib includes +CheckAAlib() +{ + AC_ARG_ENABLE(video-aalib, +AC_HELP_STRING([--enable-video-aalib], [use AAlib video driver [[default=no]]]), + , enable_video_aalib=no) + if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then + AC_MSG_CHECKING(for AAlib support) + video_aalib=no + AC_TRY_COMPILE([ + #include + ],[ + ],[ + video_aalib=yes + ]) + AC_MSG_RESULT($video_aalib) + if test x$video_aalib = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_AALIB) + SOURCES="$SOURCES $srcdir/src/video/aalib/*.c" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -laa" + have_video=yes + fi + fi +} + +dnl Find the libcaca includes +CheckCaca() +{ + AC_ARG_ENABLE(video-caca, +AC_HELP_STRING([--enable-video-caca], [use libcaca video driver [[default=no]]]), + , enable_video_caca=no) + if test x$enable_video = xyes -a x$enable_video_caca = xyes; then + video_caca=no + AC_PATH_PROG(CACACONFIG, caca-config, no) + if test x$CACACONFIG != xno; then + AC_MSG_CHECKING(for libcaca support) + CACA_CFLAGS=`$CACACONFIG --cflags` + CACA_LDFLAGS=`$CACACONFIG --libs` + save_CFLAGS="$CFLAGS" + AC_TRY_COMPILE([ + #include + ],[ + ],[ + video_caca=yes + ]) + CFLAGS="$save_CFLAGS" + AC_MSG_RESULT($video_caca) + if test x$video_caca = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_CACA) + EXTRA_CFLAGS="$EXTRA_CFLAGS $CACA_CFLAGS" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $CACA_LDFLAGS" + SOURCES="$SOURCES $srcdir/src/video/caca/*.c" + fi + fi + fi +} + +dnl Set up the QTopia video driver if enabled +CheckQtopia() +{ + AC_ARG_ENABLE(video-qtopia, +AC_HELP_STRING([--enable-video-qtopia], [use Qtopia video driver [[default=no]]]), + , enable_video_qtopia=no) + if test x$enable_video = xyes -a x$enable_video_qtopia = xyes; then + AC_MSG_CHECKING(for Qtopia support) + video_qtopia=no + QTOPIA_FLAGS="-DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG -fno-rtti -fno-exceptions" + AC_LANG_CPLUSPLUS + OLD_CXX="$CXXFLAGS" + CXXFLAGS="$QTOPIA_FLAGS" + AC_TRY_COMPILE([ + #include + ],[ + ],[ + video_qtopia=yes + ]) + CXXFLAGS="$OLD_CXX" + AC_MSG_RESULT($video_qtopia) + if test x$video_qtopia = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_QTOPIA) + SOURCES="$SOURCES $srcdir/src/video/qtopia/*.cc" + SDLMAIN_SOURCES="$srcdir/src/main/qtopia/*.cc" + EXTRA_CFLAGS="$EXTRA_CFLAGS $QTOPIA_FLAGS" + SDL_CFLAGS="$SDL_CFLAGS -DQWS -Dmain=SDL_main" + SDL_LIBS="-lSDLmain $SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte" + have_video=yes + fi + AC_LANG_C + fi +} + +dnl Set up the PicoGUI video driver if enabled +CheckPicoGUI() +{ + AC_ARG_ENABLE(video-picogui, +AC_HELP_STRING([--enable-video-picogui], [use PicoGUI video driver [[default=no]]]), + , enable_video_picogui=no) + if test x$enable_video = xyes -a x$enable_video_picogui = xyes; then + AC_MSG_CHECKING(for PicoGUI support) + video_picogui=no + AC_TRY_COMPILE([ + #include + ],[ + ],[ + video_picogui=yes + ]) + AC_MSG_RESULT($video_picogui) + if test x$video_picogui = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_PICOGUI) + SOURCES="$SOURCES $srcdir/src/video/picogui/*.c" + SDL_LIBS="$SDL_LIBS -lpgui" + have_video=yes + fi + fi +} + +dnl Set up the Atari Bios keyboard driver +CheckAtariBiosEvent() +{ + SOURCES="$SOURCES $srcdir/src/video/ataricommon/*.c" + SOURCES="$SOURCES $srcdir/src/video/ataricommon/*.S" +} + +dnl Set up the Atari Xbios driver +CheckAtariXbiosVideo() +{ + AC_ARG_ENABLE(xbios, +AC_HELP_STRING([--enable-video-xbios], [use Atari Xbios video driver [[default=yes]]]), + , enable_video_xbios=yes) + video_xbios=no + if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then + video_xbios=yes + AC_DEFINE(SDL_VIDEO_DRIVER_XBIOS) + SOURCES="$SOURCES $srcdir/src/video/xbios/*.c" + have_video=yes + fi +} + +dnl Set up the Atari Gem driver +CheckAtariGemVideo() +{ + AC_ARG_ENABLE(gem, +AC_HELP_STRING([--enable-video-gem], [use Atari Gem video driver [[default=yes]]]), + , enable_video_gem=yes) + if test x$enable_video = xyes -a x$enable_video_gem = xyes; then + video_gem=no + AC_CHECK_HEADER(gem.h, have_gem_hdr=yes) + AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes) + if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then + video_gem=yes + AC_DEFINE(SDL_VIDEO_DRIVER_GEM) + SOURCES="$SOURCES $srcdir/src/video/gem/*.c" + SDL_LIBS="$SDL_LIBS -lgem" + have_video=yes + fi + fi +} + +dnl rcg04172001 Set up the Null video driver. +CheckDummyVideo() +{ + AC_ARG_ENABLE(video-dummy, +AC_HELP_STRING([--enable-video-dummy], [use dummy video driver [[default=yes]]]), + , enable_video_dummy=yes) + if test x$enable_video_dummy = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY) + SOURCES="$SOURCES $srcdir/src/video/dummy/*.c" + have_video=yes + fi +} + +dnl Check to see if OpenGL support is desired +AC_ARG_ENABLE(video-opengl, +AC_HELP_STRING([--enable-video-opengl], [include OpenGL context creation [[default=yes]]]), + , enable_video_opengl=yes) + +dnl Find OpenGL +CheckOpenGLX11() +{ + if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then + AC_MSG_CHECKING(for OpenGL (GLX) support) + video_opengl=no + AC_TRY_COMPILE([ + #include + #include + #include + ],[ + ],[ + video_opengl=yes + ]) + AC_MSG_RESULT($video_opengl) + if test x$video_opengl = xyes; then + AC_DEFINE(SDL_VIDEO_OPENGL) + AC_DEFINE(SDL_VIDEO_OPENGL_GLX) + fi + fi +} + +dnl Find QNX RtP OpenGL +CheckOpenGLQNX() +{ + if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then + AC_MSG_CHECKING(for OpenGL (Photon) support) + video_opengl=no + AC_TRY_COMPILE([ + #include + ],[ + ],[ + video_opengl=yes + ]) + AC_MSG_RESULT($video_opengl) + if test x$video_opengl = xyes; then + AC_DEFINE(SDL_VIDEO_OPENGL) + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL" + fi + fi +} + +dnl Check for Win32 OpenGL +CheckWIN32GL() +{ + if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then + AC_DEFINE(SDL_VIDEO_OPENGL) + AC_DEFINE(SDL_VIDEO_OPENGL_WGL) + fi +} + +dnl Check for BeOS OpenGL +CheckBeGL() +{ + if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then + AC_DEFINE(SDL_VIDEO_OPENGL) + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL" + fi +} + +dnl Check for MacOS OpenGL +CheckMacGL() +{ + if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then + AC_DEFINE(SDL_VIDEO_OPENGL) + case "$host" in + *-*-darwin*) + if test x$enable_video_cocoa = xyes; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGL" + fi + if test x$enable_video_carbon = xyes; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AGL" + fi + esac + fi +} + +dnl Check for Mesa offscreen rendering +CheckAtariOSMesa() +{ + if test "x$enable_video" = "xyes" -a "x$enable_video_opengl" = "xyes"; then + AC_CHECK_HEADER(GL/osmesa.h, have_osmesa_hdr=yes) + AC_CHECK_LIB(OSMesa, OSMesaCreateContext, have_osmesa_lib=yes, have_osmesa_lib=no, -lm) + + # Static linking to -lOSMesa + AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no) + if test "x$OSMESA_CONFIG" = "xno" -o "x$enable_atari_ldg" = "xno"; then + # -lOSMesa is really the static library + if test "x$have_osmesa_hdr" = "xyes" -a "x$have_osmesa_lib" = "xyes"; then + OSMESA_LIBS="-lOSMesa" + fi + else + # -lOSMesa is a loader for OSMesa.ldg + OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags` + OSMESA_LIBS=`$OSMESA_CONFIG --libs` + fi + AC_DEFINE(SDL_VIDEO_OPENGL) + AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA) + SDL_CFLAGS="$SDL_CFLAGS $OSMESA_CFLAGS" + SDL_LIBS="$SDL_LIBS $OSMESA_LIBS" + + AC_ARG_ENABLE(osmesa-shared, +AC_HELP_STRING([--enable-osmesa-shared], [dynamically load OSMesa OpenGL support [[default=yes]]]), + , enable_osmesa_shared=yes) + if test "x$enable_osmesa_shared" = "xyes" -a "x$enable_atari_ldg" = "xyes"; then + # Dynamic linking + if test "x$have_osmesa_hdr" = "xyes"; then + AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA_DYNAMIC) + fi + fi + fi +} + +AC_ARG_ENABLE(screensaver, +AC_HELP_STRING([--enable-screensaver], [enable screensaver by default while any SDL application is running [[default=no]]]), + , enable_screensaver=no) +if test x$enable_screensaver = xno; then + AC_DEFINE(SDL_VIDEO_DISABLE_SCREENSAVER) +fi + +dnl See if we can use the new unified event interface in Linux 2.4 +CheckInputEvents() +{ + dnl Check for Linux 2.4 unified input event interface support + AC_ARG_ENABLE(input-events, +AC_HELP_STRING([--enable-input-events], [use Linux 2.4 unified input interface [[default=yes]]]), + , enable_input_events=yes) + if test x$enable_input_events = xyes; then + AC_MSG_CHECKING(for Linux 2.4 unified input interface) + use_input_events=no + AC_TRY_COMPILE([ + #include + ],[ + #ifndef EVIOCGNAME + #error EVIOCGNAME() ioctl not available + #endif + ],[ + use_input_events=yes + ]) + AC_MSG_RESULT($use_input_events) + if test x$use_input_events = xyes; then + AC_DEFINE(SDL_INPUT_LINUXEV) + fi + fi +} + +dnl See if we can use the Touchscreen input library +CheckTslib() +{ + AC_ARG_ENABLE(input-tslib, +AC_HELP_STRING([--enable-input-tslib], [use the Touchscreen library for input [[default=yes]]]), + , enable_input_tslib=yes) + if test x$enable_input_tslib = xyes; then + AC_MSG_CHECKING(for Touchscreen library support) + enable_input_tslib=no + AC_TRY_COMPILE([ + #include "tslib.h" + ],[ + ],[ + enable_input_tslib=yes + ]) + AC_MSG_RESULT($enable_input_tslib) + if test x$enable_input_tslib = xyes; then + AC_DEFINE(SDL_INPUT_TSLIB) + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts" + fi + fi +} + +dnl See if we can use GNU pth library for threads +CheckPTH() +{ + dnl Check for pth support + AC_ARG_ENABLE(pth, +AC_HELP_STRING([--enable-pth], [use GNU pth library for multi-threading [[default=yes]]]), + , enable_pth=yes) + if test x$enable_threads = xyes -a x$enable_pth = xyes; then + AC_PATH_PROG(PTH_CONFIG, pth-config, no) + if test "$PTH_CONFIG" = "no"; then + use_pth=no + else + use_pth=yes + fi + AC_MSG_CHECKING(pth) + AC_MSG_RESULT($use_pth) + if test "x$use_pth" = xyes; then + AC_DEFINE(SDL_THREAD_PTH) + SOURCES="$SOURCES $srcdir/src/thread/pth/*.c" + SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c" + SDL_CFLAGS="$SDL_CFLAGS `$PTH_CONFIG --cflags`" + SDL_LIBS="$SDL_LIBS `$PTH_CONFIG --libs --all`" + have_threads=yes + fi + fi +} + +dnl See what type of thread model to use on Linux and Solaris +CheckPTHREAD() +{ + dnl Check for pthread support + AC_ARG_ENABLE(pthreads, +AC_HELP_STRING([--enable-pthreads], [use POSIX threads for multi-threading [[default=yes]]]), + , enable_pthreads=yes) + dnl This is used on Linux for glibc binary compatibility (Doh!) + AC_ARG_ENABLE(pthread-sem, +AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]), + , enable_pthread_sem=yes) + case "$host" in + *-*-linux*|*-*-uclinux*) + pthread_cflags="-D_REENTRANT" + pthread_lib="-lpthread" + ;; + *-*-bsdi*) + pthread_cflags="-D_REENTRANT -D_THREAD_SAFE" + pthread_lib="" + ;; + *-*-darwin*) + pthread_cflags="-D_THREAD_SAFE" +# causes Carbon.p complaints? +# pthread_cflags="-D_REENTRANT -D_THREAD_SAFE" + ;; + *-*-freebsd*|*-*-dragonfly*) + pthread_cflags="-D_REENTRANT -D_THREAD_SAFE" + pthread_lib="-pthread" + ;; + *-*-netbsd*) + pthread_cflags="-D_REENTRANT -D_THREAD_SAFE" + pthread_lib="-lpthread" + ;; + *-*-openbsd*) + pthread_cflags="-D_REENTRANT" + pthread_lib="-pthread" + ;; + *-*-solaris*) + pthread_cflags="-D_REENTRANT" + pthread_lib="-lpthread -lposix4" + ;; + *-*-sysv5*) + pthread_cflags="-D_REENTRANT -Kthread" + pthread_lib="" + ;; + *-*-irix*) + pthread_cflags="-D_SGI_MP_SOURCE" + pthread_lib="-lpthread" + ;; + *-*-aix*) + pthread_cflags="-D_REENTRANT -mthreads" + pthread_lib="-lpthread" + ;; + *-*-hpux11*) + pthread_cflags="-D_REENTRANT" + pthread_lib="-L/usr/lib -lpthread" + ;; + *-*-qnx*) + pthread_cflags="" + pthread_lib="" + ;; + *-*-osf*) + pthread_cflags="-D_REENTRANT" + if test x$ac_cv_prog_gcc = xyes; then + pthread_lib="-lpthread -lrt" + else + pthread_lib="-lpthread -lexc -lrt" + fi + ;; + *) + pthread_cflags="-D_REENTRANT" + pthread_lib="-lpthread" + ;; + esac + if test x$enable_threads = xyes -a x$enable_pthreads = xyes -a x$enable_ipod != xyes; then + # Save the original compiler flags and libraries + ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS" + # Add the pthread compiler flags and libraries + CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib" + # Check to see if we have pthread support on this system + AC_MSG_CHECKING(for pthreads) + use_pthreads=no + AC_TRY_LINK([ + #include + ],[ + pthread_attr_t type; + pthread_attr_init(&type); + ],[ + use_pthreads=yes + ]) + AC_MSG_RESULT($use_pthreads) + # Restore the compiler flags and libraries + CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs" + + # Do futher testing if we have pthread support... + if test x$use_pthreads = xyes; then + AC_DEFINE(SDL_THREAD_PTHREAD) + EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib" + SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags" + SDL_LIBS="$SDL_LIBS $pthread_lib" + + # Save the original compiler flags and libraries + ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS" + # Add the pthread compiler flags and libraries + CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib" + + # Check to see if recursive mutexes are available + AC_MSG_CHECKING(for recursive mutexes) + has_recursive_mutexes=no + if test x$has_recursive_mutexes = xno; then + AC_TRY_COMPILE([ + #include + ],[ + pthread_mutexattr_t attr; + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + ],[ + has_recursive_mutexes=yes + AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX) + ]) + fi + if test x$has_recursive_mutexes = xno; then + AC_TRY_COMPILE([ + #include + ],[ + pthread_mutexattr_t attr; + pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP); + ],[ + has_recursive_mutexes=yes + AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP) + ]) + fi + AC_MSG_RESULT($has_recursive_mutexes) + + # Check to see if pthread semaphore support is missing + if test x$enable_pthread_sem = xyes; then + AC_MSG_CHECKING(for pthread semaphores) + have_pthread_sem=no + AC_TRY_COMPILE([ + #include + #include + ],[ + ],[ + have_pthread_sem=yes + ]) + AC_MSG_RESULT($have_pthread_sem) + fi + + # Restore the compiler flags and libraries + CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs" + + # Basic thread creation functions + SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systhread.c" + + # Semaphores + # We can fake these with mutexes and condition variables if necessary + if test x$have_pthread_sem = xyes; then + SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syssem.c" + else + SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c" + fi + + # Mutexes + # We can fake these with semaphores if necessary + SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_sysmutex.c" + + # Condition variables + # We can fake these with semaphores and mutexes if necessary + SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syscond.c" + + have_threads=yes + else + CheckPTH + fi + fi +} + +dnl Determine whether the compiler can produce Win32 executables +CheckWIN32() +{ + AC_MSG_CHECKING(Win32 compiler) + have_win32_gcc=no + AC_TRY_COMPILE([ + #include + ],[ + ],[ + have_win32_gcc=yes + ]) + AC_MSG_RESULT($have_win32_gcc) + if test x$have_win32_gcc != xyes; then + AC_MSG_ERROR([ +*** Your compiler ($CC) does not produce Win32 executables! + ]) + fi + + dnl See if the user wants to redirect standard output to files + AC_ARG_ENABLE(stdio-redirect, +AC_HELP_STRING([--enable-stdio-redirect], [Redirect STDIO to files on Win32 [[default=yes]]]), + , enable_stdio_redirect=yes) + if test x$enable_stdio_redirect != xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -DNO_STDIO_REDIRECT" + fi + + if test x$enable_video = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_WINDIB) + SOURCES="$SOURCES $srcdir/src/video/wincommon/*.c" + SOURCES="$SOURCES $srcdir/src/video/windib/*.c" + have_video=yes + fi +} + +dnl Find the DirectX includes and libraries +CheckDIRECTX() +{ + AC_ARG_ENABLE(directx, +AC_HELP_STRING([--enable-directx], [use DirectX for Win32 audio/video [[default=yes]]]), + , enable_directx=yes) + if test x$enable_directx = xyes; then + have_directx=no + AC_CHECK_HEADER(ddraw.h, have_ddraw=yes) + AC_CHECK_HEADER(dsound.h, have_dsound=yes) + AC_CHECK_HEADER(dinput.h, use_dinput=yes) + if test x$have_ddraw = xyes -a x$have_dsound = xyes -a x$use_dinput = xyes; then + have_directx=yes + fi + if test x$enable_video = xyes -a x$have_directx = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_DDRAW) + SOURCES="$SOURCES $srcdir/src/video/windx5/*.c" + have_video=yes + fi + fi +} + +dnl Check for the dlfcn.h interface for dynamically loading objects +CheckDLOPEN() +{ + AC_ARG_ENABLE(sdl-dlopen, +AC_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [[default=yes]]]), + , enable_sdl_dlopen=yes) + if test x$enable_sdl_dlopen = xyes; then + AC_MSG_CHECKING(for dlopen) + have_dlopen=no + AC_TRY_COMPILE([ + #include + ],[ + #if defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED <= 1020 + #error Use dlcompat for Mac OS X 10.2 compatibility + #endif + ],[ + have_dlopen=yes + ]) + AC_MSG_RESULT($have_dlopen) + + if test x$have_dlopen = xyes; then + AC_CHECK_LIB(c, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS", + AC_CHECK_LIB(dl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl", + AC_CHECK_LIB(ltdl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lltdl"))) + AC_DEFINE(SDL_LOADSO_DLOPEN) + SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c" + have_loadso=yes + fi + fi +} + +dnl Set up the Atari LDG (shared object loader) +CheckAtariLdg() +{ + AC_ARG_ENABLE(atari-ldg, +AC_HELP_STRING([--enable-atari-ldg], [use Atari LDG for shared object loading [[default=yes]]]), + , enable_atari_ldg=yes) + if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then + AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes) + AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem) + if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then + AC_DEFINE(SDL_LOADSO_LDG) + SOURCES="$SOURCES $srcdir/src/loadso/mint/*.c" + SDL_LIBS="$SDL_LIBS -lldg -lgem" + have_loadso=yes + fi + fi +} + +dnl Check for the usbhid(3) library on *BSD +CheckUSBHID() +{ + if test x$enable_joystick = xyes; then + AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes) + if test x$have_libusbhid = xyes; then + AC_CHECK_HEADER(usbhid.h, [USB_CFLAGS="-DHAVE_USBHID_H"]) + AC_CHECK_HEADER(libusbhid.h, [USB_CFLAGS="-DHAVE_LIBUSBHID_H"]) + USB_LIBS="$USB_LIBS -lusbhid" + else + AC_CHECK_HEADER(usb.h, [USB_CFLAGS="-DHAVE_USB_H"]) + AC_CHECK_HEADER(libusb.h, [USB_CFLAGS="-DHAVE_LIBUSB_H"]) + AC_CHECK_LIB(usb, hid_init, [USB_LIBS="$USB_LIBS -lusb"]) + fi + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $USB_CFLAGS" + + AC_MSG_CHECKING(for usbhid) + have_usbhid=no + AC_TRY_COMPILE([ + #include + #if defined(HAVE_USB_H) + #include + #endif + #ifdef __DragonFly__ + # include + # include + #else + # include + # include + #endif + #if defined(HAVE_USBHID_H) + #include + #elif defined(HAVE_LIBUSB_H) + #include + #elif defined(HAVE_LIBUSBHID_H) + #include + #endif + ],[ + struct report_desc *repdesc; + struct usb_ctl_report *repbuf; + hid_kind_t hidkind; + ],[ + have_usbhid=yes + ]) + AC_MSG_RESULT($have_usbhid) + + if test x$have_usbhid = xyes; then + AC_MSG_CHECKING(for ucr_data member of usb_ctl_report) + have_usbhid_ucr_data=no + AC_TRY_COMPILE([ + #include + #if defined(HAVE_USB_H) + #include + #endif + #ifdef __DragonFly__ + # include + # include + #else + # include + # include + #endif + #if defined(HAVE_USBHID_H) + #include + #elif defined(HAVE_LIBUSB_H) + #include + #elif defined(HAVE_LIBUSBHID_H) + #include + #endif + ],[ + struct usb_ctl_report buf; + if (buf.ucr_data) { } + ],[ + have_usbhid_ucr_data=yes + ]) + if test x$have_usbhid_ucr_data = xyes; then + USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA" + fi + AC_MSG_RESULT($have_usbhid_ucr_data) + + AC_MSG_CHECKING(for new usbhid API) + have_usbhid_new=no + AC_TRY_COMPILE([ + #include + #if defined(HAVE_USB_H) + #include + #endif + #ifdef __DragonFly__ + #include + #include + #else + #include + #include + #endif + #if defined(HAVE_USBHID_H) + #include + #elif defined(HAVE_LIBUSB_H) + #include + #elif defined(HAVE_LIBUSBHID_H) + #include + #endif + ],[ + report_desc_t d; + hid_start_parse(d, 1, 1); + ],[ + have_usbhid_new=yes + ]) + if test x$have_usbhid_new = xyes; then + USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW" + fi + AC_MSG_RESULT($have_usbhid_new) + + AC_MSG_CHECKING(for struct joystick in machine/joystick.h) + have_machine_joystick=no + AC_TRY_COMPILE([ + #include + ],[ + struct joystick t; + ],[ + have_machine_joystick=yes + ]) + if test x$have_machine_joystick = xyes; then + AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H) + fi + AC_MSG_RESULT($have_machine_joystick) + + AC_DEFINE(SDL_JOYSTICK_USBHID) + SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS" + have_joystick=yes + fi + CFLAGS="$save_CFLAGS" + fi +} + +dnl Check for clock_gettime() +CheckClockGettime() +{ + AC_ARG_ENABLE(clock_gettime, +AC_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [[default=no]]]), + , enable_clock_gettime=no) + if test x$enable_clock_gettime = xyes; then + AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes) + if test x$have_clock_gettime = xyes; then + AC_DEFINE(HAVE_CLOCK_GETTIME) + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt" + fi + fi +} + +dnl Check for a valid linux/version.h +CheckLinuxVersion() +{ + AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes) + if test x$have_linux_version_h = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_LINUX_VERSION_H" + fi +} + +dnl Check if we want to use RPATH +CheckRPATH() +{ + AC_ARG_ENABLE(rpath, +AC_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [[default=yes]]]), + , enable_rpath=yes) +} + +dnl Set up the configuration based on the host platform! +case "$host" in + arm-*-elf*) # FIXME: Can we get more specific for iPodLinux? + ARCH=linux + CheckDummyVideo + CheckIPod + # Set up files for the timer library + if test x$enable_timers = xyes; then + AC_DEFINE(SDL_TIMER_UNIX) + SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" + have_timers=yes + fi + ;; + *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-irix*|*-*-aix*|*-*-osf*) + case "$host" in + *-*-linux*) ARCH=linux ;; + *-*-uclinux*) ARCH=linux ;; + *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;; + *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;; + *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;; + *-*-gnu*) ARCH=gnu ;; # must be last of the gnu variants + *-*-bsdi*) ARCH=bsdi ;; + *-*-freebsd*) ARCH=freebsd ;; + *-*-dragonfly*) ARCH=freebsd ;; + *-*-netbsd*) ARCH=netbsd ;; + *-*-openbsd*) ARCH=openbsd ;; + *-*-sysv5*) ARCH=sysv5 ;; + *-*-solaris*) ARCH=solaris ;; + *-*-hpux*) ARCH=hpux ;; + *-*-irix*) ARCH=irix ;; + *-*-aix*) ARCH=aix ;; + *-*-osf*) ARCH=osf ;; + esac + CheckVisibilityHidden + CheckDummyVideo + CheckDiskAudio + CheckDummyAudio + CheckDLOPEN + CheckNASM + CheckAltivec + CheckOSS + CheckDMEDIA + CheckMME + CheckALSA + CheckARTSC + CheckESD + CheckPulseAudio + CheckNAS + CheckX11 + CheckNANOX + CheckFBCON + CheckDirectFB + CheckPS2GS + CheckPS3 + CheckGGI + CheckSVGA + CheckVGL + CheckWscons + CheckAAlib + CheckCaca + CheckQtopia + CheckPicoGUI + CheckOpenGLX11 + CheckInputEvents + CheckTslib + CheckUSBHID + CheckPTHREAD + CheckClockGettime + CheckLinuxVersion + CheckRPATH + # Set up files for the audio library + if test x$enable_audio = xyes; then + case $ARCH in + sysv5|solaris|hpux) + AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO) + SOURCES="$SOURCES $srcdir/src/audio/sun/*.c" + have_audio=yes + ;; + netbsd|openbsd) + AC_DEFINE(SDL_AUDIO_DRIVER_BSD) + SOURCES="$SOURCES $srcdir/src/audio/bsd/*.c" + have_audio=yes + ;; + aix) + AC_DEFINE(SDL_AUDIO_DRIVER_PAUD) + SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c" + have_audio=yes + ;; + esac + fi + # Set up files for the joystick library + if test x$enable_joystick = xyes; then + case $ARCH in + linux) + AC_DEFINE(SDL_JOYSTICK_LINUX) + SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c" + have_joystick=yes + ;; + esac + fi + # Set up files for the cdrom library + if test x$enable_cdrom = xyes; then + case $ARCH in + linux|solaris) + AC_DEFINE(SDL_CDROM_LINUX) + SOURCES="$SOURCES $srcdir/src/cdrom/linux/*.c" + have_cdrom=yes + ;; + *freebsd*) + AC_DEFINE(SDL_CDROM_FREEBSD) + SOURCES="$SOURCES $srcdir/src/cdrom/freebsd/*.c" + have_cdrom=yes + ;; + *openbsd*|*netbsd*) + AC_DEFINE(SDL_CDROM_OPENBSD) + SOURCES="$SOURCES $srcdir/src/cdrom/openbsd/*.c" + have_cdrom=yes + ;; + bsdi) + AC_DEFINE(SDL_CDROM_BSDI) + SOURCES="$SOURCES $srcdir/src/cdrom/bsdi/*.c" + have_cdrom=yes + ;; + aix) + AC_DEFINE(SDL_CDROM_AIX) + SOURCES="$SOURCES $srcdir/src/cdrom/aix/*.c" + have_cdrom=yes + ;; + osf) + AC_DEFINE(SDL_CDROM_OSF) + SOURCES="$SOURCES $srcdir/src/cdrom/osf/*.c" + have_cdrom=yes + ;; + esac + fi + # Set up files for the thread library + if test x$enable_threads = xyes -a x$use_pthreads != xyes -a x$use_pth != xyes -a x$ARCH = xirix; then + AC_DEFINE(SDL_THREAD_SPROC) + SOURCES="$SOURCES $srcdir/src/thread/irix/*.c" + SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c" + SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c" + have_threads=yes + fi + # Set up files for the timer library + if test x$enable_timers = xyes; then + AC_DEFINE(SDL_TIMER_UNIX) + SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" + have_timers=yes + fi + ;; + *-*-qnx*) + ARCH=qnx + CheckDummyVideo + CheckDiskAudio + CheckDummyAudio + # CheckNASM + CheckDLOPEN + CheckNAS + CheckPHOTON + CheckX11 + CheckOpenGLX11 + CheckPTHREAD + # Set up files for the audio library + if test x$enable_audio = xyes; then + AC_DEFINE(SDL_AUDIO_DRIVER_QNXNTO) + SOURCES="$SOURCES $srcdir/src/audio/nto/*.c" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lasound" + have_audio=yes + fi + # Set up files for the cdrom library + if test x$enable_cdrom = xyes; then + AC_DEFINE(SDL_CDROM_QNX) + SOURCES="$SOURCES $srcdir/src/cdrom/qnx/*.c" + have_cdrom=yes + fi + # Set up files for the timer library + if test x$enable_timers = xyes; then + AC_DEFINE(SDL_TIMER_UNIX) + SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" + have_timers=yes + fi + ;; + *-*-cygwin* | *-*-mingw32*) + ARCH=win32 + if test "$build" != "$host"; then # cross-compiling + # Default cross-compile location + ac_default_prefix=/usr/local/cross-tools/i386-mingw32 + else + # Look for the location of the tools and install there + if test "$BUILD_PREFIX" != ""; then + ac_default_prefix=$BUILD_PREFIX + fi + fi + CheckDummyVideo + CheckDiskAudio + CheckDummyAudio + CheckWIN32 + CheckWIN32GL + CheckDIRECTX + CheckNASM + # Set up files for the audio library + if test x$enable_audio = xyes; then + AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT) + SOURCES="$SOURCES $srcdir/src/audio/windib/*.c" + if test x$have_directx = xyes; then + AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND) + SOURCES="$SOURCES $srcdir/src/audio/windx5/*.c" + fi + have_audio=yes + fi + # Set up files for the joystick library + if test x$enable_joystick = xyes; then + AC_DEFINE(SDL_JOYSTICK_WINMM) + SOURCES="$SOURCES $srcdir/src/joystick/win32/*.c" + have_joystick=yes + fi + # Set up files for the cdrom library + if test x$enable_cdrom = xyes; then + AC_DEFINE(SDL_CDROM_WIN32) + SOURCES="$SOURCES $srcdir/src/cdrom/win32/*.c" + have_cdrom=yes + fi + # Set up files for the thread library + if test x$enable_threads = xyes; then + AC_DEFINE(SDL_THREAD_WIN32) + SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_sysmutex.c" + SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_syssem.c" + SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_systhread.c" + SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c" + have_threads=yes + fi + # Set up files for the timer library + if test x$enable_timers = xyes; then + AC_DEFINE(SDL_TIMER_WIN32) + SOURCES="$SOURCES $srcdir/src/timer/win32/*.c" + have_timers=yes + fi + # Set up files for the shared object loading library + if test x$enable_loadso = xyes; then + AC_DEFINE(SDL_LOADSO_WIN32) + SOURCES="$SOURCES $srcdir/src/loadso/win32/*.c" + have_loadso=yes + fi + # Set up the system libraries we need + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm" + if test x$have_directx = xyes; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldxguid" + fi + # The Win32 platform requires special setup + SOURCES="$SOURCES $srcdir/src/main/win32/*.rc" + SDLMAIN_SOURCES="$srcdir/src/main/win32/*.c" + SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main" + SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows" + ;; + *-wince*) + ARCH=win32 + CheckDummyVideo + CheckDiskAudio + CheckDummyAudio + CheckWIN32 + CheckNASM + SOURCES="$SOURCES $srcdir/src/video/gapi/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS -D_WIN32_WCE=0x420" + if test x$enable_audio = xyes; then + AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT) + SOURCES="$SOURCES $srcdir/src/audio/windib/*.c" + have_audio=yes + fi + # Set up files for the thread library + if test x$enable_threads = xyes; then + AC_DEFINE(SDL_THREAD_WIN32) + SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_sysmutex.c" + SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_syssem.c" + SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_systhread.c" + SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c" + have_threads=yes + fi + # Set up files for the timer library + if test x$enable_timers = xyes; then + AC_DEFINE(SDL_TIMER_WINCE) + SOURCES="$SOURCES $srcdir/src/timer/wince/*.c" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lcoredll -lmmtimer" + have_timers=yes + fi + # Set up files for the shared object loading library + if test x$enable_loadso = xyes; then + AC_DEFINE(SDL_LOADSO_WIN32) + SOURCES="$SOURCES $srcdir/src/loadso/win32/*.c" + have_loadso=yes + fi + # Set up the system libraries we need + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lcoredll -lcommctrl" + # The Win32 platform requires special setup + SDLMAIN_SOURCES="$srcdir/src/main/win32/*.c" + SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main -D_WIN32_WCE=0x420" + SDL_LIBS="-lSDLmain $SDL_LIBS" + ;; + *-*-beos* | *-*-haiku*) + ARCH=beos + ac_default_prefix=/boot/develop/tools/gnupro + CheckDummyVideo + CheckDiskAudio + CheckDummyAudio + CheckNASM + CheckBWINDOW + CheckBeGL + # Set up files for the audio library + if test x$enable_audio = xyes; then + AC_DEFINE(SDL_AUDIO_DRIVER_BAUDIO) + SOURCES="$SOURCES $srcdir/src/audio/baudio/*.cc" + have_audio=yes + fi + # Set up files for the joystick library + if test x$enable_joystick = xyes; then + AC_DEFINE(SDL_JOYSTICK_BEOS) + SOURCES="$SOURCES $srcdir/src/joystick/beos/*.cc" + have_joystick=yes + fi + # Set up files for the cdrom library + if test x$enable_cdrom = xyes; then + AC_DEFINE(SDL_CDROM_BEOS) + SOURCES="$SOURCES $srcdir/src/cdrom/beos/*.cc" + have_cdrom=yes + fi + # Set up files for the thread library + if test x$enable_threads = xyes; then + AC_DEFINE(SDL_THREAD_BEOS) + SOURCES="$SOURCES $srcdir/src/thread/beos/*.c" + SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c" + SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c" + have_threads=yes + fi + # Set up files for the timer library + if test x$enable_timers = xyes; then + AC_DEFINE(SDL_TIMER_BEOS) + SOURCES="$SOURCES $srcdir/src/timer/beos/*.c" + have_timers=yes + fi + # Set up files for the shared object loading library + if test x$enable_loadso = xyes; then + case "$host" in + *-*-beos*) + AC_DEFINE(SDL_LOADSO_BEOS) + SOURCES="$SOURCES $srcdir/src/loadso/beos/*.c" + ;; + *-*-haiku*) + AC_DEFINE(SDL_LOADSO_DLOPEN) + SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c" + ;; + esac + have_loadso=yes + fi + # The BeOS platform requires special setup. + SOURCES="$srcdir/src/main/beos/*.cc $SOURCES" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding" + ;; + *-*-darwin* ) + # This could be either full "Mac OS X", or plain "Darwin" which is + # just the OS X kernel sans upper layers like Carbon and Cocoa. + # Next line is broken, and a few files below require Mac OS X (full) + ARCH=macosx + + # Mac OS X builds with both the Carbon and OSX APIs at the moment + EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_CARBON" + EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_OSX" + + # HACK: Reset EXTRA_LDFLAGS; the only thing it contains at this point + # is -lm which is not needed under Mac OS X. But for some reasons it + # also tends to contain spurious -L switches, which we don't want to + # use here or in sdl-config. Hence we reset it. + EXTRA_LDFLAGS="" + + CheckVisibilityHidden + CheckDummyVideo + CheckDiskAudio + CheckDummyAudio + CheckDLOPEN + CheckNASM + + # Set up files for the shared object loading library + # (this needs to be done before the dynamic X11 check) + if test x$enable_loadso = xyes -a x$have_dlopen != xyes; then + AC_DEFINE(SDL_LOADSO_DLCOMPAT) + SOURCES="$SOURCES $srcdir/src/loadso/macosx/*.c" + have_loadso=yes + fi + + CheckCOCOA + CheckCARBON + CheckX11 + CheckMacGL + CheckOpenGLX11 + CheckPTHREAD + CheckAltivec + + # Need this or things might misbuild on a G3. + EXTRA_CFLAGS="$EXTRA_CFLAGS -force_cpusubtype_ALL" + + # Set up files for the audio library + if test x$enable_audio = xyes; then + AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO) + SOURCES="$SOURCES $srcdir/src/audio/macosx/*.c" + have_audio=yes + fi + # Set up files for the joystick library + if test x$enable_joystick = xyes; then + AC_DEFINE(SDL_JOYSTICK_IOKIT) + SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c" + have_joystick=yes + need_iokit_framework=yes + fi + # Set up files for the cdrom library + if test x$enable_cdrom = xyes; then + AC_DEFINE(SDL_CDROM_MACOSX) + SOURCES="$SOURCES $srcdir/src/cdrom/macosx/*.c" + have_cdrom=yes + fi + # Set up files for the timer library + if test x$enable_timers = xyes; then + AC_DEFINE(SDL_TIMER_UNIX) + SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" + have_timers=yes + fi + # The Mac OS X platform requires special setup. + SDLMAIN_SOURCES="$srcdir/src/main/macosx/*.m" + EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings" + SDL_LIBS="-lSDLmain $SDL_LIBS" + if test x$enable_video_cocoa = xyes; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa" + need_iokit_framework=yes + fi + if test x$enable_video_carbon = xyes -o x$enable_video_cocoa = xyes; then + # The Cocoa backend still needs Carbon + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ApplicationServices" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon" + fi + # If either the audio or CD driver is used, add the AudioUnit framework + if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit" + fi + # Some subsystems reference IOKit... + if test x$need_iokit_framework = xyes; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit" + fi + ;; + *-*-mint*) + ARCH=mint + CheckDummyVideo + CheckDiskAudio + CheckDummyAudio + CheckAtariBiosEvent + CheckAtariXbiosVideo + CheckAtariGemVideo + CheckAtariAudio + CheckAtariLdg + CheckAtariOSMesa + CheckPTH + # Set up files for the audio library + if test x$enable_threads = xyes -a x$enable_pth = xyes; then + if test x$enable_audio = xyes; then + AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO) + SOURCES="$SOURCES $srcdir/src/audio/sun/*.c" + have_audio=yes + fi + fi + # Set up files for the joystick library + if test x$enable_joystick = xyes; then + AC_DEFINE(SDL_JOYSTICK_MINT) + SOURCES="$SOURCES $srcdir/src/joystick/mint/*.c" + have_joystick=yes + fi + # Set up files for the cdrom library + if test x$enable_cdrom = xyes; then + AC_DEFINE(SDL_CDROM_MINT) + SOURCES="$SOURCES $srcdir/src/cdrom/mint/*.c" + have_cdrom=yes + fi + # Set up files for the timer library + if test x$enable_timers = xyes; then + if test x$enable_threads = xyes -a x$enable_pth = xyes; then + AC_DEFINE(SDL_TIMER_UNIX) + SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" + else + AC_DEFINE(SDL_TIMER_MINT) + SOURCES="$SOURCES $srcdir/src/timer/mint/*.c" + SOURCES="$SOURCES $srcdir/src/timer/mint/*.S" + fi + have_timers=yes + fi + ;; + *-riscos) + ARCH=riscos + CheckOSS + CheckPTHREAD + # Set up files for the video library + if test x$enable_video = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_RISCOS) + SOURCES="$SOURCES $srcdir/src/video/riscos/*.c" + SOURCES="$SOURCES $srcdir/src/video/riscos/*.S" + have_video=yes + fi + # Set up files for the joystick library + if test x$enable_joystick = xyes; then + AC_DEFINE(SDL_JOYSTICK_RISCOS) + SOURCES="$SOURCES $srcdir/src/joystick/riscos/*.c" + have_joystick=yes + fi + # Set up files for the timer library + if test x$enable_timers = xyes; then + AC_DEFINE(SDL_TIMER_RISCOS) + SOURCES="$SOURCES $srcdir/src/timer/riscos/*.c" + have_timers=yes + fi + # The RISC OS platform requires special setup. + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ljpeg -ltiff -lpng -lz" + ;; + *) + AC_MSG_ERROR([ +*** Unsupported host: Please add to configure.in + ]) + ;; +esac + +# Verify that we have all the platform specific files we need + +if test x$enable_joystick = xyes; then + if test x$have_joystick != xyes; then + # Wants joystick subsystem, but doesn't have a platform-specific backend... + AC_DEFINE(SDL_JOYSTICK_DUMMY) + SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c" + fi +fi +if test x$have_cdrom != xyes; then + if test x$enable_cdrom = xyes; then + AC_DEFINE(SDL_CDROM_DISABLED) + fi + SOURCES="$SOURCES $srcdir/src/cdrom/dummy/*.c" +fi +if test x$have_threads != xyes; then + if test x$enable_threads = xyes; then + AC_DEFINE(SDL_THREADS_DISABLED) + fi + SOURCES="$SOURCES $srcdir/src/thread/generic/*.c" +fi +if test x$have_timers != xyes; then + if test x$enable_timers = xyes; then + AC_DEFINE(SDL_TIMERS_DISABLED) + fi + SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c" +fi +if test x$have_loadso != xyes; then + if test x$enable_loadso = xyes; then + AC_DEFINE(SDL_LOADSO_DISABLED) + fi + SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c" +fi +if test x$SDLMAIN_SOURCES = x; then + SDLMAIN_SOURCES="$srcdir/src/main/dummy/*.c" +fi + +OBJECTS=`echo $SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.asm,$(objects)/\1.lo,g'` +OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.lo,g'` +OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.lo,g'` +OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'` +OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.S,$(objects)/\1.lo,g'` +OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'` + +SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.o,g'` +SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.o,g'` +SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'` + +# Set runtime shared library paths as needed + +if test "x$enable_rpath" = "xyes"; then + if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = irix -o $ARCH = linux -o $ARCH = netbsd; then + SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}" + fi + if test $ARCH = solaris; then + SDL_RLD_FLAGS="-R\${libdir}" + fi +else + SDL_RLD_FLAGS="" +fi + +case "$ARCH" in + macosx) + if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then + SDL_LIBS="$SDL_LIBS -Wl,-framework,Cocoa" + fi + if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then + SDL_LIBS="$SDL_LIBS -Wl,-framework,Carbon" + fi + # Evil hack to allow static linking on Mac OS X + SDL_STATIC_LIBS="\${libdir}/libSDLmain.a \${libdir}/libSDL.a $EXTRA_LDFLAGS" + ;; + *) + SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS" + ;; +esac + +dnl Expand the cflags and libraries needed by apps using SDL +AC_SUBST(SDL_CFLAGS) +AC_SUBST(SDL_LIBS) +AC_SUBST(SDL_STATIC_LIBS) +AC_SUBST(SDL_RLD_FLAGS) +if test x$enable_shared = xyes; then + ENABLE_SHARED_TRUE= + ENABLE_SHARED_FALSE="#" +else + ENABLE_SHARED_TRUE="#" + ENABLE_SHARED_FALSE= +fi +if test x$enable_static = xyes; then + ENABLE_STATIC_TRUE= + ENABLE_STATIC_FALSE="#" +else + ENABLE_STATIC_TRUE="#" + ENABLE_STATIC_FALSE= +fi +AC_SUBST(ENABLE_SHARED_TRUE) +AC_SUBST(ENABLE_SHARED_FALSE) +AC_SUBST(ENABLE_STATIC_TRUE) +AC_SUBST(ENABLE_STATIC_FALSE) + +dnl Expand the sources and objects needed to build the library +AC_SUBST(ac_aux_dir) +AC_SUBST(INCLUDE) +AC_SUBST(SOURCES) +AC_SUBST(OBJECTS) +AC_SUBST(SDLMAIN_SOURCES) +AC_SUBST(SDLMAIN_OBJECTS) +AC_SUBST(BUILD_CFLAGS) +AC_SUBST(EXTRA_CFLAGS) +AC_SUBST(BUILD_LDFLAGS) +AC_SUBST(EXTRA_LDFLAGS) +AC_SUBST(WINDRES) + +AC_OUTPUT([ + Makefile sdl-config SDL.spec SDL.qpg sdl.pc +], [ + : >build-deps + if test x"$MAKE" = x; then MAKE=make; fi; $MAKE depend +]) diff --git a/docs.html b/docs.html new file mode 100644 index 0000000..66ca923 --- /dev/null +++ b/docs.html @@ -0,0 +1,629 @@ + +SDL Stable Release + + +[separator] +

+This source is stable, and is fully tested on all supported platforms.
+Please send bug reports or questions to the SDL mailing list:
+http://www.libsdl.org/mailing-list.php
+The latest stable release may be found on the + SDL website. +

+ +

API Documentation

+ +[separator] + +

SDL 1.2.14 Release Notes

+

+SDL 1.2.14 is a significant bug fix release and a recommended update. +

+ +

General Notes

+ +
+

+ Fixed flicker when resizing the SDL window +

+

+ Fixed crash in SDL_SetGammaRamp() +

+

+ Fixed freeze in SDL_memset() with 0 length when assembly code is disabled. +

+

+ Added SDL_DISABLE_LOCK_KEYS environment variable to enable normal up/down events for Caps-Lock and Num-Lock keys. +

+

+ Fixed audio quality problem when converting between 22050 Hz and 44100 Hz. +

+

+ Fixed a threading crash when a few threads are rapidly created and complete. +

+

+ Increased accuracy of alpha blending routines. +

+

+ Fixed crash loading BMP files saved with the scanlines inverted. +

+

+ Fixed mouse coordinate clamping if SDL_SetVideoMode() isn't called in response to SDL_VIDEORESIZE event. +

+

+ Added doxygen documentation for the SDL API headers. +

+
+ +

Unix Notes

+ +
+

+ Fixed potential memory corruption due to assembly bug with SDL_revcpy() +

+

+ Fixed crashes trying to detect SSE features on x86_64 architecture. +

+

+ Fixed assembly for GCC optimized 50% alpha blending blits. +

+

+ Added configure option --enable-screensaver, to allow enabling the screensaver by default. +

+

+ Use XResetScreenSaver() instead of disabling screensaver entirely. +

+

+ Removed the maximum window size limitation on X11. +

+

+ Fixed SDL_GL_SWAP_CONTROL on X11. +

+

+ Fixed setting the X11 window input hint. +

+

+ Fixed distorted X11 window icon for some visuals. +

+

+ Fixed detecting X11 libraries for dynamic loading on 64-bit Linux. +

+

+ SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL) returns the correct value with GLX_SGI_swap_control. +

+

+ Added SDL_VIDEO_FULLSCREEN_DISPLAY as a preferred synonym for SDL_VIDEO_FULLSCREEN_HEAD on X11. +

+

+ The SDL_VIDEO_FULLSCREEN_DISPLAY environment variable can be set to 0 to place fullscreen SDL windows on the first Xinerama screen. +

+

+ Added the SDL_VIDEO_FBCON_ROTATION environment variable to control output orientation on the framebuffer console. +
+ Valid values are: +

    +
  • not set - Not rotating, no shadow. +
  • "NONE" - Not rotating, but still using shadow. +
  • "CW" - Rotating screen clockwise. +
  • "UD" - Rotating screen upside down. +
  • "CCW" - Rotating screen counter clockwise. +
+

+

+ Fixed DirectFB detection on some Linux distributions. +

+

+ Added code to use the PS3 SPE processors for YUV conversion on Linux. +

+

+ Updated ALSA support to the latest stable API +

+

+ ALSA is now preferred over OSS audio. (SDL_AUDIODRIVER=dsp will restore the previous behavior.) +

+

+ Improved support for PulseAudio +

+

+ The Network Audio System support is now dynamically loaded at runtime. +

+

+ Fixed crash with the MP-8866 Dual USB Joypad on newer Linux kernels. +

+

+ Fixed crash in SDL_Quit() when a joystick has been unplugged. +

+
+ +

Windows Notes

+ +
+

+ Verified 100% compatibility with Windows 7. +

+

+ Prevent loss of OpenGL context when setting the video mode in response to a window resize event. +

+

+ Fixed video initialization with SDL_WINDOWID on Windows XP. +

+

+ Improved mouse input responsiveness for first-person-shooter games. +

+

+ IME messages are now generated for localized input. +

+

+ SDL_RWFromFile() takes a UTF-8 filename when opening a file. +

+

+ The SDL_STDIO_REDIRECT environment variable can be used to override whether SDL redirects stdio to stdout.txt and stderr.txt. +

+

+ Fixed dynamic object loading on Windows CE. +

+
+ +

Mac OS X Notes

+ +
+

+ SDL now builds on Mac OS X 10.6 (Snow Leopard). +
+ Eric Wing posted a good rundown on the numerous changes here: http://playcontrol.net/ewing/jibberjabber/big_behind-the-scenes_chang.html +

+

+ The X11 video driver is built by default. +

+

+ Fixed SDL_VIDEO_WINDOW_POS environment variable for Quartz target. +

+

+ Fixed setting the starting working directory in release builds. +

+
+ +[separator] + +

SDL 1.2.13 Release Notes

+

+SDL 1.2.13 is a minor bug fix release. +

+ +

General Notes

+ +
+

+ Fixed link error when building with Intel Compiler 10. +

+

+ Removed stray C++ comment from public headers. +

+
+ +

Unix Notes

+ +
+

+ Fixed crash in SDL_SoftStretch() on secure operating systems. +

+

+ Fixed undefined symbol on X11 implementations without UTF-8 support. +

+

+ Worked around BadAlloc error when using XVideo on the XFree86 Intel Integrated Graphics driver. +

+

+ Scan for all joysticks on Linux instead of stopping at one that was removed. +

+

+ Fixed use of sdl-config arguments in sdl.m4 +

+
+ +

Windows Notes

+ +
+

+ Fixed crash when a video driver reports higher than 32 bpp video modes. +

+

+ Fixed restoring the desktop after setting a 24-bit OpenGL video mode. +

+

+ Fixed window titles on Windows 95/98/ME. +

+

+ Added SDL_BUTTON_X1 and SDL_BUTTON_X2 constants for extended mouse buttons. +

+

+ Added support for quoted command line arguments. +

+
+ +

Mac OS X Notes

+ +
+

+ SDL now builds on Mac OS X 10.5 (Leopard). +

+

+ Fixed high frequency crash involving text input. +

+

+ Fixed beeping when the escape key is pressed and UNICODE translation is enabled. +

+

+ Improved trackpad scrolling support. +

+

+ Fixed joystick hat reporting for certain joysticks. +

+
+ +[separator] + +

SDL 1.2.12 Release Notes

+

+SDL 1.2.12 is a minor bug fix release. +

+ +

General Notes

+ +
+

+ Added support for the PulseAudio sound server: http://www.pulseaudio.org/ +

+

+ Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling of the screensaver on Mac OS X, Windows, and X11. +

+

+ Fixed buffer overrun crash when resampling audio rates. +

+

+ Fixed audio bug where converting to mono was doubling the volume. +

+

+ Fixed off-by-one error in the C implementation of SDL_revcpy() +

+

+ Fixed compiling with Sun Studio. +

+

+ Support for AmigaOS has been removed from the main SDL code. +

+

+ Support for Nokia 9210 "EPOC" driver has been removed from the main SDL code. +

+

+ Unofficial support for the S60/SymbianOS platform has been added. +

+

+ Unofficial support for the Nintendo DS platform has been added. +

+

+ Reenabled MMX assembly for YUV overlay processing (GNU C Compiler only). +

+
+ +

Unix Notes

+ +
+

+ Fixed detection of X11 DGA mouse support. +

+

+ Improved XIM support for asian character sets. +

+

+ The GFX_Display has been added to the X11 window information in SDL_syswm.h. +

+

+ Fixed PAGE_SIZE compile error in the fbcon video driver on newer Linux kernels. +

+

+ Fixed hang or crash at startup if aRts can't access the hardware. +

+

+ Fixed relative mouse mode when the cursor starts outside the X11 window. +

+

+ Fixed accidental free of stack memory in X11 mouse acceleration code. +

+

+ Closed minor memory leak in XME code. +

+

+ Fixed TEXTRELs in the library to resolve some PIC issues. +

+
+ +

Windows Notes

+ +
+

+ The GDI video driver makes better use of the palette in 8-bit modes. +

+

+ The windib driver now supports more mouse buttons with WM_XBUTTON events. +

+

+ On Windows, SDL_SetVideoMode() will re-create the window instead of failing if the multisample settings are changed. +

+

+ Added support for UTF-8 window titles on Windows. +

+

+ Fixed joystick detection on Windows. +

+

+ Improved performance with Win32 file I/O. +

+

+ Fixed HBITMAP leak in GAPI driver. +

+
+ +

Mac OS X Notes

+ +
+

+ Added support for multi-axis controllers like 3Dconnxion's SpaceNavigator on Mac OS X. +

+

+ Fixed YUV overlay crash inside Quicktime on Intel Mac OS X. +

+

+ Fixed blitting alignment in Altivec alpha blit functions. +

+

+ Keys F13, F14, and F15 are now usable on Apple keyboards under Mac OS X. +

+

+ Fixed joystick calibration code on Mac OS X. +

+

+ Fixed mouse jitter when multiple motion events are queued up in Mac OS X. +

+

+ Fixed changing the cursor in fullscreen mode on Mac OS X. +

+
+ +

Mac OS Classic Notes

+ +
+

+ Added support for gamma ramps to both toolbox and DrawSprocket video drivers. +

+
+ +

BeOS Notes

+ +
+

+ Implemented mouse grabbing and mouse relative mode on BeOS. +

+
+ +[separator] + +

SDL 1.2.11 Release Notes

+

+SDL 1.2.11 is a minor bug fix release. +

+ +

Unix Notes

+ +
+

+ Dynamic X11 loading is only enabled with gcc 4 supporting -fvisibility=hidden. This fixes crashes related to symbol collisions, and allows building on Solaris and IRIX. +

+

+ Fixed building SDL with Xinerama disabled. +

+

+ Fixed DRI OpenGL library loading, using RTLD_GLOBAL in dlopen(). +

+

+ Added pkgconfig configuration support. +

+
+ +

Windows Notes

+ +
+

+ Setting SDL_GL_SWAP_CONTROL now works with Windows OpenGL. +

+

+ The Win32 window positioning code works properly for windows with menus. +

+

+ DirectSound audio quality has been improved on certain sound cards. +

+

+ Fixed 5.1 audio channel ordering on Windows and Mac OS X. +

+

+ Plugged a couple of minor memory leaks in the windib video driver. +

+

+ Fixed type collision with stdint.h when building with gcc on Win32. +

+

+ Fixed building with the Digital Mars Compiler on Win32. +

+
+ +

Mac OS X Notes

+ +
+

+ The Quartz video driver supports 32x32 cursors on Mac OS X 10.3 and above. +

+
+ +[separator] + +

SDL 1.2.10 Release Notes

+

+SDL 1.2.10 is a major release, featuring a revamp of the build system and many API improvements and bug fixes. +

+

API enhancements

+
    +
  • + If SDL_OpenAudio() is passed zero for the desired format + fields, the following environment variables will be used + to fill them in: +
    
    +		SDL_AUDIO_FREQUENCY
    +		SDL_AUDIO_FORMAT
    +		SDL_AUDIO_CHANNELS
    +		SDL_AUDIO_SAMPLES
    +
    + If an environment variable is not specified, it will be set + to a reasonable default value. +
  • + SDL_SetVideoMode() now accepts 0 for width or height and will use + the current video mode (or the desktop mode if no mode has been set.) +
  • + Added current_w and current_h to the SDL_VideoInfo structure, + which is set to the desktop resolution during video intialization, + and then set to the current resolution when a video mode is set. +
  • + SDL_GL_LoadLibrary() will load the system default OpenGL library + if it is passed NULL as a parameter. +
  • + Added SDL_GL_SWAP_CONTROL to wait for vsync in OpenGL applications. +
  • + Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration. +
  • + SDL_WM_SetCaption() now officially takes UTF-8 title and icon strings, and displays international characters on supported platforms. +
  • + Added SDL_GetKeyRepeat() to query the key repeat settings. +
  • + Added the "dummy" audio driver, which can be used to emulate audio + output without a sound card. +
  • + Added SDL_config.h, with defaults for various build environments. +
+ +

General Notes

+ +
+

+ The SDL website now has an RSS feed! +

+ The SDL development source code is now managed with Subversion. +

+ SDL now uses the Bugzilla bug tracking system, hosted by icculus.org. +

+ SDL is licensed under version 2.1 of the GNU Lesser General Public License. +

+ The entire build system has been revamped to make it much more portable, including versions of C library functions to make it possible to run SDL on a minimal embedded environment. See README.Porting in the SDL source distribution for information on how to port SDL to a new platform. +

+ SDL_opengl.h has been updated with the latest glext.h from http://oss.sgi.com/projects/ogl-sample/registry/ +

+ Alex Volkov contributed highly optimized RGB <-> RGBA blitters. +

+ +

Unix Notes

+ +
+

+ The X11 libraries are dynamically loaded at runtime by default. This allows the distributed version of SDL to run on systems without X11 libraries installed. +

+ The XiG XME extension code is now included in the X11 video driver by default. +

+ XRandR support for video mode switching has been added to the X11 driver, but is disabled because of undesired interactions with window managers. You can enable this by setting the environment variable SDL_VIDEO_X11_XRANDR to 1. +

+ Xinerama multi-head displays are properly handled now, and the SDL_VIDEO_FULLSCREEN_HEAD environment variable can be used to select the screen used for fullscreen video modes. Note that changing the video modes only works on screen 0. +

+ XVidMode video modes are now sorted so they maintain the refresh rates specified in the X11 configuration file. +

+ SDL windows are no longer transparent in X11 compositing systems like XGL. +

+ The mouse is properly released by the X11 video driver if the fullscreen window loses focus. +

+ The X11 input driver now uses XIM to handle international input. +

+ The screensaver and DPMS monitor blanking are disabled while SDL games are running under the X11 and DGA video drivers. This behavior will be formalized and selectable in SDL 1.3. +

+ Fixed a bug preventing stereo OpenGL contexts from being selected on the X11 driver. +

+ The DGA video driver now waits for pending blits involving surfaces before they are freed. This prevents display oddities when using SDL_DisplayFormat() to convert many images. +

+ The framebuffer console video driver now has a parser for /etc/fb.modes for improved video mode handling. +

+ The framebuffer console video driver now allows asynchronous VT switching, and restores the full contents of the screen when switched back. +

+ The framebuffer console now uses CTRL-ALT-FN to switch virtual terminals, to avoid collisions with application key bindings. +

+ The framebuffer console input driver correctly sets IMPS/2 mode for wheel mice. It also properly detects when gpm is in IMPS/2 protocol mode, or passing raw protocol from an IMPS/2 mouse. +

+ The SVGAlib video driver now has support for banked (non-linear) video modes. +

+ A video driver for OpenBSD on the Sharp Zaurus has been contributed by Staffan Ulfberg. See the file README.wscons in the SDL source distribution for details. +

+ Many patches have been incorporated from *BSD ports. +

+ +

Windows Notes

+ +
+

+ The "windib" video driver is the default now, to prevent problems with certain laptops, 64-bit Windows, and Windows Vista. The DirectX driver is still available, and can be selected by setting the environment variable SDL_VIDEODRIVER to "directx". +

+ SDL has been ported to 64-bit Windows. +

+ Dmitry Yakimov contributed a GAPI video driver for Windows CE. +

+ The default fullscreen refresh rate has been increased to match the desktop refresh rate, when using equivalent resolutions. A full API for querying and selecting refresh rates is planned for SDL 1.3. +

+ Dialog boxes are now shown when SDL is in windowed OpenGL mode. +

+ The SDL window is recreated when necessary to maintain OpenGL context attributes, when switching between windowed and fullscreen modes. +

+ An SDL_VIDEORESIZE event is properly sent when the SDL window is maximized and restored. +

+ Window positions are retained when switching between fullscreen and windowed modes. +

+ ToUnicode() is used, when available, for improved handling of international keyboard input. +

+ The PrtScrn is now treated normally with both key down and key up events. +

+ Pressing ALT-F4 now delivers an SDL_QUIT event to SDL applications. +

+ Joystick names are now correct for joysticks which have been unplugged and then plugged back in since booting. +

+ An MCI error when playing the last track on a CD-ROM has been fixed. +

+ OpenWatcom projects for building SDL have been provided by Marc Peter. +

+ +

Mac OS X Notes

+ +
+

+ SDL now supports building Universal binaries, both through Xcode projects and when using configure/make. See README.MacOSX in the SDL source archive for details. +

+ The X11 video driver with GLX support can be built on Mac OS X, if the X11 development SDK is installed. +

+ Transitions between fullscreen resolutions and windowed mode now use a much faster asynchronous fade to hide desktop flicker. +

+ Icons set with SDL_WM_SetIcon() now have the proper colors on Intel Macs. +

+ +

OS/2 Notes

+ +
+

+ Projects for building SDL on OS/2 with OpenWatcom have been contributed by Doodle. See the file README.OS2 in the SDL source distribution for details. +

+ +[separator] + + + diff --git a/docs/html/audio.html b/docs/html/audio.html new file mode 100644 index 0000000..94075e2 --- /dev/null +++ b/docs/html/audio.html @@ -0,0 +1,242 @@ +Audio
SDL Library Documentation
PrevNext

Chapter 10. Audio

Table of Contents
SDL_AudioSpec -- Audio Specification Structure
SDL_OpenAudio -- Opens the audio device with the desired parameters.
SDL_PauseAudio -- Pauses and unpauses the audio callback processing
SDL_GetAudioStatus -- Get the current audio state
SDL_LoadWAV -- Load a WAVE file
SDL_FreeWAV -- Frees previously opened WAV data
SDL_AudioCVT -- Audio Conversion Structure
SDL_BuildAudioCVT -- Initializes a SDL_AudioCVT structure for conversion
SDL_ConvertAudio -- Convert audio data to a desired audio format.
SDL_MixAudio -- Mix audio data
SDL_LockAudio -- Lock out the callback function
SDL_UnlockAudio -- Unlock the callback function
SDL_CloseAudio -- Shuts down audio processing and closes the audio device.

Sound on the computer is translated from waves that you hear into a series of +values, or samples, each representing the amplitude of the wave. When these +samples are sent in a stream to a sound card, an approximation of the original +wave can be recreated. The more bits used to represent the amplitude, and the +greater frequency these samples are gathered, the closer the approximated +sound is to the original, and the better the quality of sound.

This library supports both 8 and 16 bit signed and unsigned sound samples, +at frequencies ranging from 11025 Hz to 44100 Hz, depending on the +underlying hardware. If the hardware doesn't support the desired audio +format or frequency, it can be emulated if desired (See +SDL_OpenAudio())

A commonly supported audio format is 16 bits per sample at 22050 Hz.


PrevHomeNext
SDL_JoystickCloseUpSDL_AudioSpec
\ No newline at end of file diff --git a/docs/html/cdrom.html b/docs/html/cdrom.html new file mode 100644 index 0000000..bdd6bfd --- /dev/null +++ b/docs/html/cdrom.html @@ -0,0 +1,260 @@ +CD-ROM
SDL Library Documentation
PrevNext

Chapter 11. CD-ROM

Table of Contents
SDL_CDNumDrives -- Returns the number of CD-ROM drives on the system.
SDL_CDName -- Returns a human-readable, system-dependent identifier for the CD-ROM.
SDL_CDOpen -- Opens a CD-ROM drive for access.
SDL_CDStatus -- Returns the current status of the given drive.
SDL_CDPlay -- Play a CD
SDL_CDPlayTracks -- Play the given CD track(s)
SDL_CDPause -- Pauses a CDROM
SDL_CDResume -- Resumes a CDROM
SDL_CDStop -- Stops a CDROM
SDL_CDEject -- Ejects a CDROM
SDL_CDClose -- Closes a SDL_CD handle
SDL_CD -- CDROM Drive Information
SDL_CDtrack -- CD Track Information Structure

SDL supports audio control of up to 32 local CD-ROM drives at once.

You use this API to perform all the basic functions of a CD player, +including listing the tracks, playing, stopping, and ejecting the CD-ROM. +(Currently, multi-changer CD drives are not supported.)

Before you call any of the SDL CD-ROM functions, you must first call +"SDL_Init(SDL_INIT_CDROM)", which scans the system for +CD-ROM drives, and sets the program up for audio control. Check the +return code, which should be 0, to see if there +were any errors in starting up.

After you have initialized the library, you can find out how many drives +are available using the SDL_CDNumDrives() function. +The first drive listed is the system default CD-ROM drive. After you have +chosen a drive, and have opened it with SDL_CDOpen(), +you can check the status and start playing if there's a CD in the drive.

A CD-ROM is organized into one or more tracks, each consisting of a certain +number of "frames". Each frame is ~2K in size, and at normal playing speed, +a CD plays 75 frames per second. SDL works with the number of frames on a +CD, but this can easily be converted to the more familiar minutes/seconds +format by using the FRAMES_TO_MSF() macro.


PrevHomeNext
SDL_CloseAudioUpSDL_CDNumDrives
\ No newline at end of file diff --git a/docs/html/event.html b/docs/html/event.html new file mode 100644 index 0000000..f2bddb2 --- /dev/null +++ b/docs/html/event.html @@ -0,0 +1,216 @@ +Events
SDL Library Documentation
PrevNext

Chapter 8. Events

Introduction

Event handling allows your application to receive input from the user. Event handling is initalised (along with video) with a call to: +

SDL_Init(SDL_INIT_VIDEO);
+Internally, SDL stores all the events waiting to be handled in an event queue. Using functions like SDL_PollEvent and SDL_PeepEvents you can observe and handle waiting input events.

The key to event handling in SDL is the SDL_Event union. The event queue itself is composed of a series of SDL_Event unions, one for each waiting event. SDL_Event unions are read from the queue with the SDL_PollEvent function and it is then up to the application to process the information stored with them.


PrevHomeNext
SDL_WM_GrabInputUpSDL Event Structures.
\ No newline at end of file diff --git a/docs/html/eventfunctions.html b/docs/html/eventfunctions.html new file mode 100644 index 0000000..f68a29a --- /dev/null +++ b/docs/html/eventfunctions.html @@ -0,0 +1,481 @@ +Event Functions.
SDL Library Documentation
PrevChapter 8. EventsNext

Event Functions.

Table of Contents
SDL_PumpEvents -- Pumps the event loop, gathering events from the input devices.
SDL_PeepEvents -- Checks the event queue for messages and optionally returns them.
SDL_PollEvent -- Polls for currently pending events.
SDL_WaitEvent -- Waits indefinitely for the next available event.
SDL_PushEvent -- Pushes an event onto the event queue
SDL_SetEventFilter -- Sets up a filter to process all events before they are posted +to the event queue.
SDL_GetEventFilter -- Retrieves a pointer to he event filter
SDL_EventState -- This function allows you to set the state of processing certain events.
SDL_GetKeyState -- Get a snapshot of the current keyboard state
SDL_GetModState -- Get the state of modifier keys.
SDL_SetModState -- Set the current key modifier state
SDL_GetKeyName -- Get the name of an SDL virtual keysym
SDL_EnableUNICODE -- Enable UNICODE translation
SDL_EnableKeyRepeat -- Set keyboard repeat rate.
SDL_GetMouseState -- Retrieve the current state of the mouse
SDL_GetRelativeMouseState -- Retrieve the current state of the mouse
SDL_GetAppState -- Get the state of the application
SDL_JoystickEventState -- Enable/disable joystick event polling

SDL_PumpEventsPumps the event loop, gathering events from the input devices
SDL_PeepEventsChecks the event queue for messages and optionally returns them
SDL_PollEventPolls for currently pending events
SDL_WaitEventWaits indefinitely for the next available event
SDL_PushEventPushes an event onto the event queue
SDL_SetEventFilterSets up a filter to process all events
SDL_EventStateAllows you to set the state of processing certain events
SDL_GetKeyStateGet a snapshot of the current keyboard state
SDL_GetModStateGet the state of modifier keys
SDL_SetModStateSet the state of modifier keys
SDL_GetKeyNameGet the name of an SDL virtual keysym
SDL_EnableUNICODEEnable UNICODE translation
SDL_EnableKeyRepeatSet keyboard repeat rate
SDL_GetMouseStateRetrieve the current state of the mouse
SDL_GetRelativeMouseStateRetrieve the current state of the mouse
SDL_GetAppStateGet the state of the application
SDL_JoystickEventStateEnable/disable joystick event polling


PrevHomeNext
SDLKeyUpSDL_PumpEvents
\ No newline at end of file diff --git a/docs/html/eventstructures.html b/docs/html/eventstructures.html new file mode 100644 index 0000000..c959296 --- /dev/null +++ b/docs/html/eventstructures.html @@ -0,0 +1,233 @@ +SDL Event Structures.
SDL Library Documentation
PrevChapter 8. EventsNext

SDL Event Structures.

Table of Contents
SDL_Event -- General event structure
SDL_ActiveEvent -- Application visibility event structure
SDL_KeyboardEvent -- Keyboard event structure
SDL_MouseMotionEvent -- Mouse motion event structure
SDL_MouseButtonEvent -- Mouse button event structure
SDL_JoyAxisEvent -- Joystick axis motion event structure
SDL_JoyButtonEvent -- Joystick button event structure
SDL_JoyHatEvent -- Joystick hat position change event structure
SDL_JoyBallEvent -- Joystick trackball motion event structure
SDL_ResizeEvent -- Window resize event structure
SDL_ExposeEvent -- Quit requested event
SDL_SysWMEvent -- Platform-dependent window manager event.
SDL_UserEvent -- A user-defined event type
SDL_QuitEvent -- Quit requested event
SDL_keysym -- Keysym structure
SDLKey -- Keysym definitions.

PrevHomeNext
EventsUpSDL_Event
\ No newline at end of file diff --git a/docs/html/general.html b/docs/html/general.html new file mode 100644 index 0000000..0beb591 --- /dev/null +++ b/docs/html/general.html @@ -0,0 +1,225 @@ +General
SDL Library Documentation
PrevNext

Chapter 5. General

Table of Contents
SDL_Init -- Initializes SDL
SDL_InitSubSystem -- Initialize subsystems
SDL_QuitSubSystem -- Shut down a subsystem
SDL_Quit -- Shut down SDL
SDL_WasInit -- Check which subsystems are initialized
SDL_GetError -- Get SDL error string
SDL_envvars -- SDL environment variables

Before SDL can be used in a program it must be initialized with SDL_Init. SDL_Init initializes all the subsystems that the user requests (video, audio, joystick, timers and/or cdrom). Once SDL is initialized with SDL_Init subsystems can be shut down and initialized as needed using SDL_InitSubSystem and SDL_QuitSubSystem.

SDL must also be shut down before the program exits to make sure it cleans up correctly. Calling SDL_Quit shuts down all subsystems and frees any resources allocated to SDL.


PrevHomeNext
SDL ReferenceUpSDL_Init
\ No newline at end of file diff --git a/docs/html/guide.html b/docs/html/guide.html new file mode 100644 index 0000000..2c1297e --- /dev/null +++ b/docs/html/guide.html @@ -0,0 +1,174 @@ +SDL Guide
SDL Library Documentation
PrevNext

I. SDL Guide


PrevHomeNext
SDL Library Documentation Preface
\ No newline at end of file diff --git a/docs/html/guideaboutsdldoc.html b/docs/html/guideaboutsdldoc.html new file mode 100644 index 0000000..cdb0d78 --- /dev/null +++ b/docs/html/guideaboutsdldoc.html @@ -0,0 +1,148 @@ +About SDLdoc
SDL Library Documentation
PrevPrefaceNext

About SDLdoc

SDLdoc (The SDL Documentation Project) was formed to completely rewrite the SDL documentation and to keep it continually up to date. The team consists completely of volunteers ranging from people working with SDL in their spare time to people who use SDL in their everyday working lives.

The latest version of this documentation can always be found here: http://sdldoc.csn.ul.ie Downloadable PS, man pages and html tarballs are available at http://sdldoc.csn.ul.ie/pub/


PrevHomeNext
PrefaceUpCredits
\ No newline at end of file diff --git a/docs/html/guideaudioexamples.html b/docs/html/guideaudioexamples.html new file mode 100644 index 0000000..afb7522 --- /dev/null +++ b/docs/html/guideaudioexamples.html @@ -0,0 +1,228 @@ +Audio Examples
SDL Library Documentation
PrevChapter 4. ExamplesNext

Audio Examples

Opening the audio device

    SDL_AudioSpec wanted;
+    extern void fill_audio(void *udata, Uint8 *stream, int len);
+
+    /* Set the audio format */
+    wanted.freq = 22050;
+    wanted.format = AUDIO_S16;
+    wanted.channels = 2;    /* 1 = mono, 2 = stereo */
+    wanted.samples = 1024;  /* Good low-latency value for callback */
+    wanted.callback = fill_audio;
+    wanted.userdata = NULL;
+
+    /* Open the audio device, forcing the desired format */
+    if ( SDL_OpenAudio(&wanted, NULL) < 0 ) {
+        fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
+        return(-1);
+    }
+    return(0);

Playing audio

    static Uint8 *audio_chunk;
+    static Uint32 audio_len;
+    static Uint8 *audio_pos;
+
+    /* The audio function callback takes the following parameters:
+       stream:  A pointer to the audio buffer to be filled
+       len:     The length (in bytes) of the audio buffer
+    */
+    void fill_audio(void *udata, Uint8 *stream, int len)
+    {
+        /* Only play if we have data left */
+        if ( audio_len == 0 )
+            return;
+
+        /* Mix as much data as possible */
+        len = ( len > audio_len ? audio_len : len );
+        SDL_MixAudio(stream, audio_pos, len, SDL_MIX_MAXVOLUME);
+        audio_pos += len;
+        audio_len -= len;
+    }
+
+    /* Load the audio data ... */
+
+    ;;;;;
+
+    audio_pos = audio_chunk;
+
+    /* Let the callback function play the audio chunk */
+    SDL_PauseAudio(0);
+
+    /* Do some processing */
+
+    ;;;;;
+
+    /* Wait for sound to complete */
+    while ( audio_len > 0 ) {
+        SDL_Delay(100);         /* Sleep 1/10 second */
+    }
+    SDL_CloseAudio();


PrevHomeNext
Event ExamplesUpCDROM Examples
\ No newline at end of file diff --git a/docs/html/guidebasicsinit.html b/docs/html/guidebasicsinit.html new file mode 100644 index 0000000..faafdbd --- /dev/null +++ b/docs/html/guidebasicsinit.html @@ -0,0 +1,240 @@ +Initializing SDL
SDL Library Documentation
PrevChapter 1. The BasicsNext

Initializing SDL

SDL is composed of eight subsystems - Audio, CDROM, Event Handling, File I/O, Joystick Handling, Threading, Timers and Video. Before you can use any of these subsystems they must be initialized by calling SDL_Init (or SDL_InitSubSystem). SDL_Init must be called before any other SDL function. It automatically initializes the Event Handling, File I/O and Threading subsystems and it takes a parameter specifying which other subsystems to initialize. So, to initialize the default subsystems and the Video subsystems you would call: +

    SDL_Init ( SDL_INIT_VIDEO );
+To initialize the default subsystems, the Video subsystem and the Timers subsystem you would call: +
    SDL_Init ( SDL_INIT_VIDEO | SDL_INIT_TIMER );

SDL_Init is complemented by SDL_Quit (and SDL_QuitSubSystem). SDL_Quit shuts down all subsystems, including the default ones. It should always be called before a SDL application exits.

With SDL_Init and SDL_Quit firmly embedded in your programmers toolkit you can write your first and most basic SDL application. However, we must be prepare to handle errors. Many SDL functions return a value and indicates whether the function has succeeded or failed, SDL_Init, for instance, returns -1 if it could not initialize a subsystem. SDL provides a useful facility that allows you to determine exactly what the problem was, every time an error occurs within SDL an error message is stored which can be retrieved using SDL_GetError. Use this often, you can never know too much about an error.

Example 1-1. Initializing SDL

#include "SDL.h"   /* All SDL App's need this */
+#include <stdio.h>
+
+int main(int argc, char *argv[]) {
+    
+    printf("Initializing SDL.\n");
+    
+    /* Initialize defaults, Video and Audio */
+    if((SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO)==-1)) { 
+        printf("Could not initialize SDL: %s.\n", SDL_GetError());
+        exit(-1);
+    }
+
+    printf("SDL initialized.\n");
+
+    printf("Quiting SDL.\n");
+    
+    /* Shutdown all subsystems */
+    SDL_Quit();
+    
+    printf("Quiting....\n");
+
+    exit(0);
+}

PrevHomeNext
The BasicsUpGraphics and Video
\ No newline at end of file diff --git a/docs/html/guidecdromexamples.html b/docs/html/guidecdromexamples.html new file mode 100644 index 0000000..2bc5a16 --- /dev/null +++ b/docs/html/guidecdromexamples.html @@ -0,0 +1,275 @@ +CDROM Examples
SDL Library Documentation
PrevChapter 4. ExamplesNext

CDROM Examples

Listing CD-ROM drives

    #include "SDL.h"
+
+    /* Initialize SDL first */
+    if ( SDL_Init(SDL_INIT_CDROM) < 0 ) {
+        fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
+        exit(1);
+    }
+    atexit(SDL_Quit);
+
+    /* Find out how many CD-ROM drives are connected to the system */
+    printf("Drives available: %d\n", SDL_CDNumDrives());
+    for ( i=0; i<SDL_CDNumDrives(); ++i ) {
+        printf("Drive %d:  \"%s\"\n", i, SDL_CDName(i));
+    }

Opening the default drive

    SDL_CD *cdrom;
+    CDstatus status;
+    char *status_str;
+
+    cdrom = SDL_CDOpen(0);
+    if ( cdrom == NULL ) {
+        fprintf(stderr, "Couldn't open default CD-ROM drive: %s\n",
+                        SDL_GetError());
+        exit(2);
+    }
+
+    status = SDL_CDStatus(cdrom);
+    switch (status) {
+        case CD_TRAYEMPTY:
+            status_str = "tray empty";
+            break;
+        case CD_STOPPED:
+            status_str = "stopped";
+            break;
+        case CD_PLAYING:
+            status_str = "playing";
+            break;
+        case CD_PAUSED:
+            status_str = "paused";
+            break;
+        case CD_ERROR:
+            status_str = "error state";
+            break;
+    }
+    printf("Drive status: %s\n", status_str);
+    if ( status >= CD_PLAYING ) {
+        int m, s, f;
+        FRAMES_TO_MSF(cdrom->cur_frame, &m, &s, &f);
+        printf("Currently playing track %d, %d:%2.2d\n",
+        cdrom->track[cdrom->cur_track].id, m, s);
+    }

Listing the tracks on a CD

    SDL_CD *cdrom;          /* Assuming this has already been set.. */
+    int i;
+    int m, s, f;
+
+    SDL_CDStatus(cdrom);
+    printf("Drive tracks: %d\n", cdrom->numtracks);
+    for ( i=0; i<cdrom->numtracks; ++i ) {
+        FRAMES_TO_MSF(cdrom->track[i].length, &m, &s, &f);
+        if ( f > 0 )
+            ++s;
+        printf("\tTrack (index %d) %d: %d:%2.2d\n", i,
+        cdrom->track[i].id, m, s);
+    }

Play an entire CD

    SDL_CD *cdrom;          /* Assuming this has already been set.. */
+
+    // Play entire CD:
+    if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
+        SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
+
+        // Play last track:
+        if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
+            SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0);
+        }
+
+        // Play first and second track and 10 seconds of third track:
+        if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
+            SDL_CDPlayTracks(cdrom, 0, 0, 2, CD_FPS * 10);


PrevHomeNext
Audio ExamplesUpTime Examples
\ No newline at end of file diff --git a/docs/html/guidecredits.html b/docs/html/guidecredits.html new file mode 100644 index 0000000..b66b28f --- /dev/null +++ b/docs/html/guidecredits.html @@ -0,0 +1,195 @@ +Credits
SDL Library Documentation
PrevPrefaceNext

Credits

Sam Lantinga, slouken@libsdl.org
Martin Donlon, akawaka@skynet.ie
Mattias Engdegård
Julian Peterson
Ken Jordan
Maxim Sobolev
Wesley Poole
Michael Vance
Andreas Umbach
Andreas Hofmeister


PrevHomeNext
About SDLdocUpThe Basics
\ No newline at end of file diff --git a/docs/html/guideeventexamples.html b/docs/html/guideeventexamples.html new file mode 100644 index 0000000..3001369 --- /dev/null +++ b/docs/html/guideeventexamples.html @@ -0,0 +1,247 @@ +Event Examples
SDL Library Documentation
PrevChapter 4. ExamplesNext

Event Examples

Filtering and Handling Events

#include <stdio.h>
+#include <stdlib.h>
+
+#include "SDL.h"
+
+/* This function may run in a separate event thread */
+int FilterEvents(const SDL_Event *event) {
+    static int boycott = 1;
+
+    /* This quit event signals the closing of the window */
+    if ( (event->type == SDL_QUIT) && boycott ) {
+        printf("Quit event filtered out -- try again.\n");
+        boycott = 0;
+        return(0);
+    }
+    if ( event->type == SDL_MOUSEMOTION ) {
+        printf("Mouse moved to (%d,%d)\n",
+                event->motion.x, event->motion.y);
+        return(0);    /* Drop it, we've handled it */
+    }
+    return(1);
+}
+
+int main(int argc, char *argv[])
+{
+    SDL_Event event;
+
+    /* Initialize the SDL library (starts the event loop) */
+    if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
+        fprintf(stderr,
+                "Couldn't initialize SDL: %s\n", SDL_GetError());
+        exit(1);
+    }
+
+    /* Clean up on exit, exit on window close and interrupt */
+    atexit(SDL_Quit);
+
+    /* Ignore key events */
+    SDL_EventState(SDL_KEYDOWN, SDL_IGNORE);
+    SDL_EventState(SDL_KEYUP, SDL_IGNORE);
+
+    /* Filter quit and mouse motion events */
+    SDL_SetEventFilter(FilterEvents);
+
+    /* The mouse isn't much use unless we have a display for reference */
+    if ( SDL_SetVideoMode(640, 480, 8, 0) == NULL ) {
+        fprintf(stderr, "Couldn't set 640x480x8 video mode: %s\n",
+                        SDL_GetError());
+        exit(1);
+    }
+
+    /* Loop waiting for ESC+Mouse_Button */
+    while ( SDL_WaitEvent(&event) >= 0 ) {
+        switch (event.type) {
+            case SDL_ACTIVEEVENT: {
+                if ( event.active.state & SDL_APPACTIVE ) {
+                    if ( event.active.gain ) {
+                        printf("App activated\n");
+                    } else {
+                        printf("App iconified\n");
+                    }
+                }
+            }
+            break;
+                    
+            case SDL_MOUSEBUTTONDOWN: {
+                Uint8 *keys;
+
+                keys = SDL_GetKeyState(NULL);
+                if ( keys[SDLK_ESCAPE] == SDL_PRESSED ) {
+                    printf("Bye bye...\n");
+                    exit(0);
+                }
+                printf("Mouse button pressed\n");
+            }
+            break;
+
+            case SDL_QUIT: {
+                printf("Quit requested, quitting.\n");
+                exit(0);
+            }
+            break;
+        }
+    }
+    /* This should never happen */
+    printf("SDL_WaitEvent error: %s\n", SDL_GetError());
+    exit(1);
+}


PrevHomeNext
ExamplesUpAudio Examples
\ No newline at end of file diff --git a/docs/html/guideexamples.html b/docs/html/guideexamples.html new file mode 100644 index 0000000..5b9a847 --- /dev/null +++ b/docs/html/guideexamples.html @@ -0,0 +1,188 @@ +Examples
SDL Library Documentation
PrevNext

Chapter 4. Examples

Introduction

For the moment these examples are taken directly from the old SDL documentation. By the 1.2 release these examples should hopefully deal with most common SDL programming problems.


PrevHomeNext
Handling the KeyboardUpEvent Examples
\ No newline at end of file diff --git a/docs/html/guideinput.html b/docs/html/guideinput.html new file mode 100644 index 0000000..4a82b67 --- /dev/null +++ b/docs/html/guideinput.html @@ -0,0 +1,739 @@ +Input handling
SDL Library Documentation
PrevNext

Chapter 3. Input handling

Handling Joysticks

Initialization

The first step in using a joystick in a SDL program is to initialize the Joystick subsystems of SDL. This done by passing the SDL_INIT_JOYSTICK flag to SDL_Init. The joystick flag will usually be used in conjunction with other flags (like the video flag) because the joystick is usually used to control something.

Example 3-1. Initializing SDL with Joystick Support

    if (SDL_Init( SDL_INIT_VIDEO | SDL_INIT_JOYSTICK ) < 0)
+    {
+        fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
+        exit(1);
+    }

This will attempt to start SDL with both the video and the joystick subsystems activated.

Querying

If we have reached this point then we can safely assume that the SDL library has been initialized and that the Joystick subsystem is active. We can now call some video and/or sound functions to get things going before we need the joystick. Eventually we have to make sure that there is actually a joystick to work with. It's wise to always check even if you know a joystick will be present on the system because it can also help detect when the joystick is unplugged. The function used to check for joysticks is SDL_NumJoysticks.

This function simply returns the number of joysticks available on the system. If it is at least one then we are in good shape. The next step is to determine which joystick the user wants to use. If the number of joysticks available is only one then it is safe to assume that one joystick is the one the user wants to use. SDL has a function to get the name of the joysticks as assigned by the operations system and that function is SDL_JoystickName. The joystick is specified by an index where 0 is the first joystick and the last joystick is the number returned by SDL_NumJoysticks - 1. In the demonstration a list of all available joysticks is printed to stdout.

Example 3-2. Querying the Number of Available Joysticks

    printf("%i joysticks were found.\n\n", SDL_NumJoysticks() );
+    printf("The names of the joysticks are:\n");
+		
+    for( i=0; i < SDL_NumJoysticks(); i++ ) 
+    {
+        printf("    %s\n", SDL_JoystickName(i));
+    }

Opening a Joystick and Receiving Joystick Events

SDL's event driven architecture makes working with joysticks a snap. Joysticks can trigger 4 different types of events: +

SDL_JoyAxisEventOccurs when an axis changes
SDL_JoyBallEventOccurs when a joystick trackball's position changes
SDL_JoyHatEventOccurs when a hat's position changes
SDL_JoyButtonEventOccurs when a button is pressed or released

Events are received from all joysticks opened. The first thing that needs to be done in order to receive joystick events is to call SDL_JoystickEventState with the SDL_ENABLE flag. Next you must open the joysticks that you want to receive envents from. This is done with the SDL_JoystickOpen function. For the example we are only interested in events from the first joystick on the system, regardless of what it may be. To receive events from it we would do this:

Example 3-3. Opening a Joystick

    SDL_Joystick *joystick;
+
+    SDL_JoystickEventState(SDL_ENABLE);
+    joystick = SDL_JoystickOpen(0);

If we wanted to receive events for other joysticks we would open them with calls to SDL_JoystickOpen just like we opened joystick 0, except we would store the SDL_Joystick structure they return in a different pointer. We only need the joystick pointer when we are querying the joysticks or when we are closing the joystick.

Up to this point all the code we have is used just to initialize the joysticks in order to read values at run time. All we need now is an event loop, which is something that all SDL programs should have anyway to receive the systems quit events. We must now add code to check the event loop for at least some of the above mentioned events. Let's assume our event loop looks like this: +

    SDL_Event event;
+    /* Other initializtion code goes here */   
+
+    /* Start main game loop here */
+
+    while(SDL_PollEvent(&event))
+    {  
+        switch(event.type)
+        {  
+            case SDL_KEYDOWN:
+            /* handle keyboard stuff here */				
+            break;
+
+            case SDL_QUIT:
+            /* Set whatever flags are necessary to */
+            /* end the main game loop here */
+            break;
+        }
+    }
+
+    /* End loop here */
+To handle Joystick events we merely add cases for them, first we'll add axis handling code. Axis checks can get kinda of tricky because alot of the joystick events received are junk. Joystick axis have a tendency to vary just a little between polling due to the way they are designed. To compensate for this you have to set a threshold for changes and ignore the events that have'nt exceeded the threshold. 10% is usually a good threshold value. This sounds a lot more complicated than it is. Here is the Axis event handler:

Example 3-4. Joystick Axis Events

    case SDL_JOYAXISMOTION:  /* Handle Joystick Motion */
+    if ( ( event.jaxis.value < -3200 ) || (event.jaxis.value > 3200 ) ) 
+    {
+      /* code goes here */
+    }
+    break;

Another trick with axis events is that up-down and left-right movement are two different sets of axes. The most important axis is axis 0 (left-right) and axis 1 (up-down). To handle them seperatly in the code we do the following:

Example 3-5. More Joystick Axis Events

    case SDL_JOYAXISMOTION:  /* Handle Joystick Motion */
+    if ( ( event.jaxis.value < -3200 ) || (event.jaxis.value > 3200 ) ) 
+    {
+        if( event.jaxis.axis == 0) 
+        {
+            /* Left-right movement code goes here */
+        }
+
+        if( event.jaxis.axis == 1) 
+        {
+            /* Up-Down movement code goes here */
+        }
+    }
+    break;

Ideally the code here should use event.jaxis.value to scale something. For example lets assume you are using the joystick to control the movement of a spaceship. If the user is using an analog joystick and they push the stick a little bit they expect to move less than if they pushed it a lot. Designing your code for this situation is preferred because it makes the experience for users of analog controls better and remains the same for users of digital controls.

If your joystick has any additional axis then they may be used for other sticks or throttle controls and those axis return values too just with different event.jaxis.axis values.

Button handling is simple compared to the axis checking.

Example 3-6. Joystick Button Events

    case SDL_JOYBUTTONDOWN:  /* Handle Joystick Button Presses */
+    if ( event.jbutton.button == 0 ) 
+    {
+        /* code goes here */
+    }
+    break;

Button checks are simpler than axis checks because a button can only be pressed or not pressed. The SDL_JOYBUTTONDOWN event is triggered when a button is pressed and the SDL_JOYBUTTONUP event is fired when a button is released. We do have to know what button was pressed though, that is done by reading the event.jbutton.button field.

Lastly when we are through using our joysticks we should close them with a call to SDL_JoystickClose. To close our opened joystick 0 we would do this at the end of our program: +

    SDL_JoystickClose(joystick);

Advanced Joystick Functions

That takes care of the controls that you can count on being on every joystick under the sun, but there are a few extra things that SDL can support. Joyballs are next on our list, they are alot like axis with a few minor differences. Joyballs store relative changes unlike the the absolute postion stored in a axis event. Also one trackball event contains both the change in x and they change in y. Our case for it is as follows:

Example 3-7. Joystick Ball Events

    case SDL_JOYBALLMOTION:  /* Handle Joyball Motion */
+    if( event.jball.ball == 0 )
+    {
+      /* ball handling */
+    }
+    break;

The above checks the first joyball on the joystick. The change in position will be stored in event.jball.xrel and event.jball.yrel.

Finally we have the hat event. Hats report only the direction they are pushed in. We check hat's position with the bitmasks: + +

SDL_HAT_CENTERED
SDL_HAT_UP
SDL_HAT_RIGHT
SDL_HAT_DOWN
SDL_HAT_LEFT

+ +Also there are some predefined combinations of the above: +

SDL_HAT_RIGHTUP
SDL_HAT_RIGHTDOWN
SDL_HAT_LEFTUP
SDL_HAT_LEFTDOWN

+ +Our case for the hat may resemble the following:

Example 3-8. Joystick Hat Events

    case SDL_JOYHATMOTION:  /* Handle Hat Motion */
+    if ( event.jhat.value & SDL_HAT_UP )
+    {
+        /* Do up stuff here */
+    }
+
+    if ( event.jhat.value & SDL_HAT_LEFT )
+    {
+        /* Do left stuff here */
+    }
+
+    if ( event.jhat.value & SDL_HAT_RIGHTDOWN )
+    {
+        /* Do right and down together stuff here */
+    }
+    break;

In addition to the queries for number of joysticks on the system and their names there are additional functions to query the capabilities of attached joysticks: +

SDL_JoystickNumAxesReturns the number of joysitck axes
SDL_JoystickNumButtonsReturns the number of joysitck buttons
SDL_JoystickNumBallsReturns the number of joysitck balls
SDL_JoystickNumHatsReturns the number of joysitck hats

+ +To use these functions we just have to pass in the joystick structure we got when we opened the joystick. For Example:

Example 3-9. Querying Joystick Characteristics

    int number_of_buttons;
+    SDL_Joystick *joystick;
+
+    joystick = SDL_JoystickOpen(0);
+    number_of_buttons = SDL_JoystickNumButtons(joystick);

This block of code would get the number of buttons on the first joystick in the system.


PrevHomeNext
Using OpenGL With SDLUpHandling the Keyboard
\ No newline at end of file diff --git a/docs/html/guideinputkeyboard.html b/docs/html/guideinputkeyboard.html new file mode 100644 index 0000000..787036c --- /dev/null +++ b/docs/html/guideinputkeyboard.html @@ -0,0 +1,746 @@ +Handling the Keyboard
SDL Library Documentation
PrevChapter 3. Input handlingNext

Handling the Keyboard

Keyboard Related Structures

It should make it a lot easier to understand this tutorial is you are familiar with the data types involved in keyboard access, so I'll explain them first.

SDLKey

SDLKey is an enumerated type defined in SDL/include/SDL_keysym.h and detailed here. Each SDLKey symbol represents a key, SDLK_a corresponds to the 'a' key on a keyboard, SDLK_SPACE corresponds to the space bar, and so on.

SDLMod

SDLMod is an enumerated type, similar to SDLKey, however it enumerates keyboard modifiers (Control, Alt, Shift). The full list of modifier symbols is here. SDLMod values can be AND'd together to represent several modifiers.

SDL_keysym

typedef struct{
+  Uint8 scancode;
+  SDLKey sym;
+  SDLMod mod;
+  Uint16 unicode;
+} SDL_keysym;

The SDL_keysym structure describes a key press or a key release. The scancode field is hardware specific and should be ignored unless you know what your doing. The sym field is the SDLKey value of the key being pressed or released. The mod field describes the state of the keyboard modifiers at the time the key press or release occurred. So a value of KMOD_NUM | KMOD_CAPS | KMOD_LSHIFT would mean that Numlock, Capslock and the left shift key were all press (or enabled in the case of the lock keys). Finally, the unicode field stores the 16-bit unicode value of the key.

Note: It should be noted and understood that this field is only valid when the SDL_keysym is describing a key press, not a key release. Unicode values only make sense on a key press because the unicode value describes an international character and only key presses produce characters. More information on Unicode can be found at www.unicode.org

Note: Unicode translation must be enabled using the SDL_EnableUNICODE function.

SDL_KeyboardEvent

typedef struct{
+  Uint8 type;
+  Uint8 state;
+  SDL_keysym keysym;
+} SDL_KeyboardEvent;

The SDL_KeyboardEvent describes a keyboard event (obviously). The key member of the SDL_Event union is a SDL_KeyboardEvent structure. The type field specifies whether the event is a key release (SDL_KEYUP) or a key press (SDL_KEYDOWN) event. The state is largely redundant, it reports the same information as the type field but uses different values (SDL_RELEASED and SDL_PRESSED). The keysym contains information of the key press or release that this event represents (see above).

Reading Keyboard Events

Reading keybaord events from the event queue is quite simple (the event queue and using it is described here). We read events using SDL_PollEvent in a while() loop and check for SDL_KEYUP and SDL_KEYDOWN events using a switch statement, like so:

Example 3-10. Reading Keyboard Events

  SDL_Event event;
+  .
+  .
+  /* Poll for events. SDL_PollEvent() returns 0 when there are no  */
+  /* more events on the event queue, our while loop will exit when */
+  /* that occurs.                                                  */
+  while( SDL_PollEvent( &event ) ){
+    /* We are only worried about SDL_KEYDOWN and SDL_KEYUP events */
+    switch( event.type ){
+      case SDL_KEYDOWN:
+        printf( "Key press detected\n" );
+        break;
+
+      case SDL_KEYUP:
+        printf( "Key release detected\n" );
+        break;
+
+      default:
+        break;
+    }
+  }
+  .
+  .

This is a very basic example. No information about the key press or release is interpreted. We will explore the other extreme out our first full example below - reporting all available information about a keyboard event.

A More Detailed Look

Before we can read events SDL must be initialised with SDL_Init and a video mode must be set using SDL_SetVideoMode. There are, however, two other functions we must use to obtain all the information required. We must enable unicode translation by calling SDL_EnableUNICODE(1) and we must convert SDLKey values into something printable, using SDL_GetKeyName

Note: It is useful to note that unicode values < 0x80 translate directly a characters ASCII value. THis is used in the example below

Example 3-11. Interpreting Key Event Information


    #include "SDL.h"
+
+    /* Function Prototypes */
+    void PrintKeyInfo( SDL_KeyboardEvent *key );
+    void PrintModifiers( SDLMod mod );
+
+    /* main */
+    int main( int argc, char *argv[] ){
+        
+        SDL_Event event;
+        int quit = 0;
+        
+        /* Initialise SDL */
+        if( SDL_Init( SDL_INIT_VIDEO ) < 0){
+            fprintf( stderr, "Could not initialise SDL: %s\n", SDL_GetError() );
+            exit( -1 );
+        }
+
+        /* Set a video mode */
+        if( !SDL_SetVideoMode( 320, 200, 0, 0 ) ){
+            fprintf( stderr, "Could not set video mode: %s\n", SDL_GetError() );
+            SDL_Quit();
+            exit( -1 );
+        }
+
+        /* Enable Unicode translation */
+        SDL_EnableUNICODE( 1 );
+
+        /* Loop until an SDL_QUIT event is found */
+        while( !quit ){
+
+            /* Poll for events */
+            while( SDL_PollEvent( &event ) ){
+                
+                switch( event.type ){
+                    /* Keyboard event */
+                    /* Pass the event data onto PrintKeyInfo() */
+                    case SDL_KEYDOWN:
+                    case SDL_KEYUP:
+                        PrintKeyInfo( &event.key );
+                        break;
+
+                    /* SDL_QUIT event (window close) */
+                    case SDL_QUIT:
+                        quit = 1;
+                        break;
+
+                    default:
+                        break;
+                }
+
+            }
+
+        }
+
+        /* Clean up */
+        SDL_Quit();
+        exit( 0 );
+    }
+
+    /* Print all information about a key event */
+    void PrintKeyInfo( SDL_KeyboardEvent *key ){
+        /* Is it a release or a press? */
+        if( key->type == SDL_KEYUP )
+            printf( "Release:- " );
+        else
+            printf( "Press:- " );
+
+        /* Print the hardware scancode first */
+        printf( "Scancode: 0x%02X", key->keysym.scancode );
+        /* Print the name of the key */
+        printf( ", Name: %s", SDL_GetKeyName( key->keysym.sym ) );
+        /* We want to print the unicode info, but we need to make */
+        /* sure its a press event first (remember, release events */
+        /* don't have unicode info                                */
+        if( key->type == SDL_KEYDOWN ){
+            /* If the Unicode value is less than 0x80 then the    */
+            /* unicode value can be used to get a printable       */
+            /* representation of the key, using (char)unicode.    */
+            printf(", Unicode: " );
+            if( key->keysym.unicode < 0x80 && key->keysym.unicode > 0 ){
+                printf( "%c (0x%04X)", (char)key->keysym.unicode,
+                        key->keysym.unicode );
+            }
+            else{
+                printf( "? (0x%04X)", key->keysym.unicode );
+            }
+        }
+        printf( "\n" );
+        /* Print modifier info */
+        PrintModifiers( key->keysym.mod );
+    }
+
+    /* Print modifier info */
+    void PrintModifiers( SDLMod mod ){
+        printf( "Modifers: " );
+
+        /* If there are none then say so and return */
+        if( mod == KMOD_NONE ){
+            printf( "None\n" );
+            return;
+        }
+
+        /* Check for the presence of each SDLMod value */
+        /* This looks messy, but there really isn't    */
+        /* a clearer way.                              */
+        if( mod & KMOD_NUM ) printf( "NUMLOCK " );
+        if( mod & KMOD_CAPS ) printf( "CAPSLOCK " );
+        if( mod & KMOD_LCTRL ) printf( "LCTRL " );
+        if( mod & KMOD_RCTRL ) printf( "RCTRL " );
+        if( mod & KMOD_RSHIFT ) printf( "RSHIFT " );
+        if( mod & KMOD_LSHIFT ) printf( "LSHIFT " );
+        if( mod & KMOD_RALT ) printf( "RALT " );
+        if( mod & KMOD_LALT ) printf( "LALT " );
+        if( mod & KMOD_CTRL ) printf( "CTRL " );
+        if( mod & KMOD_SHIFT ) printf( "SHIFT " );
+        if( mod & KMOD_ALT ) printf( "ALT " );
+        printf( "\n" );
+    }

Game-type Input

I have found that people using keyboard events for games and other interactive applications don't always understand one fundemental point.

Keyboard events only take place when a keys state changes from being unpressed to pressed, and vice versa.

Imagine you have an image of an alien that you wish to move around using the cursor keys: when you pressed the left arrow key you want him to slide over to the left, and when you press the down key you want him to slide down the screen. Examine the following code; it highlights an error that many people have made. +

    /* Alien screen coordinates */
+    int alien_x=0, alien_y=0;
+    .
+    .
+    /* Initialise SDL and video modes and all that */
+    .
+    /* Main game loop */
+    /* Check for events */
+    while( SDL_PollEvent( &event ) ){
+        switch( event.type ){
+            /* Look for a keypress */
+            case SDL_KEYDOWN:
+                /* Check the SDLKey values and move change the coords */
+                switch( event.key.keysym.sym ){
+                    case SDLK_LEFT:
+                        alien_x -= 1;
+                        break;
+                    case SDLK_RIGHT:
+                        alien_x += 1;
+                        break;
+                    case SDLK_UP:
+                        alien_y -= 1;
+                        break;
+                    case SDLK_DOWN:
+                        alien_y += 1;
+                        break;
+                    default:
+                        break;
+                }
+            }
+        }
+    }
+    .
+    .
+At first glance you may think this is a perfectly reasonable piece of code for the task, but it isn't. Like I said keyboard events only occur when a key changes state, so the user would have to press and release the left cursor key 100 times to move the alien 100 pixels to the left.

To get around this problem we must not use the events to change the position of the alien, we use the events to set flags which are then used in a seperate section of code to move the alien. Something like this:

Example 3-12. Proper Game Movement

    /* Alien screen coordinates */
+    int alien_x=0, alien_y=0;
+    int alien_xvel=0, alien_yvel=0;
+    .
+    .
+    /* Initialise SDL and video modes and all that */
+    .
+    /* Main game loop */
+    /* Check for events */
+    while( SDL_PollEvent( &event ) ){
+        switch( event.type ){
+            /* Look for a keypress */
+            case SDL_KEYDOWN:
+                /* Check the SDLKey values and move change the coords */
+                switch( event.key.keysym.sym ){
+                    case SDLK_LEFT:
+                        alien_xvel = -1;
+                        break;
+                    case SDLK_RIGHT:
+                        alien_xvel =  1;
+                        break;
+                    case SDLK_UP:
+                        alien_yvel = -1;
+                        break;
+                    case SDLK_DOWN:
+                        alien_yvel =  1;
+                        break;
+                    default:
+                        break;
+                }
+                break;
+            /* We must also use the SDL_KEYUP events to zero the x */
+            /* and y velocity variables. But we must also be       */
+            /* careful not to zero the velocities when we shouldn't*/
+            case SDL_KEYUP:
+                switch( event.key.keysym.sym ){
+                    case SDLK_LEFT:
+                        /* We check to make sure the alien is moving */
+                        /* to the left. If it is then we zero the    */
+                        /* velocity. If the alien is moving to the   */
+                        /* right then the right key is still press   */
+                        /* so we don't tocuh the velocity            */
+                        if( alien_xvel < 0 )
+                            alien_xvel = 0;
+                        break;
+                    case SDLK_RIGHT:
+                        if( alien_xvel > 0 )
+                            alien_xvel = 0;
+                        break;
+                    case SDLK_UP:
+                        if( alien_yvel < 0 )
+                            alien_yvel = 0;
+                        break;
+                    case SDLK_DOWN:
+                        if( alien_yvel > 0 )
+                            alien_yvel = 0;
+                        break;
+                    default:
+                        break;
+                }
+                break;
+            
+            default:
+                break;
+        }
+    }
+    .
+    .
+    /* Update the alien position */
+    alien_x += alien_xvel;
+    alien_y += alien_yvel;

As can be seen, we use two extra variables, alien_xvel and alien_yvel, which represent the motion of the ship, it is these variables that we update when we detect keypresses and releases.


PrevHomeNext
Input handlingUpExamples
\ No newline at end of file diff --git a/docs/html/guidepreface.html b/docs/html/guidepreface.html new file mode 100644 index 0000000..9986fc6 --- /dev/null +++ b/docs/html/guidepreface.html @@ -0,0 +1,178 @@ +Preface
SDL Library Documentation
PrevNext

Preface

About SDL

The SDL library is designed to make it easy to write games that run on Linux, *BSD, MacOS, Win32 and BeOS using the various native high-performance media interfaces, (for video, audio, etc) and presenting a single source-code level API to your application. SDL is a fairly low level API, but using it, completely portable applications can be written with a great deal of flexibility.


PrevHomeNext
SDL GuideUpAbout SDLdoc
\ No newline at end of file diff --git a/docs/html/guidethebasics.html b/docs/html/guidethebasics.html new file mode 100644 index 0000000..4f32363 --- /dev/null +++ b/docs/html/guidethebasics.html @@ -0,0 +1,173 @@ +The Basics
SDL Library Documentation
PrevNext

Chapter 1. The Basics

Introduction

The SDL Guide section is pretty incomplete. If you feel you have anything to add mail akawaka@skynet.ie or visit http://akawaka.csn.ul.ie/tne/.


PrevHomeNext
CreditsUpInitializing SDL
\ No newline at end of file diff --git a/docs/html/guidetimeexamples.html b/docs/html/guidetimeexamples.html new file mode 100644 index 0000000..42b5019 --- /dev/null +++ b/docs/html/guidetimeexamples.html @@ -0,0 +1,183 @@ +Time Examples
SDL Library Documentation
PrevChapter 4. ExamplesNext

Time Examples

Time based game loop

#define TICK_INTERVAL    30
+
+static Uint32 next_time;
+
+Uint32 time_left(void)
+{
+    Uint32 now;
+
+    now = SDL_GetTicks();
+    if(next_time <= now)
+        return 0;
+    else
+        return next_time - now;
+}
+
+
+/* main game loop */
+
+    next_time = SDL_GetTicks() + TICK_INTERVAL;
+    while ( game_running ) {
+        update_game_state();
+        SDL_Delay(time_left());
+        next_time += TICK_INTERVAL;
+    }


PrevHomeNext
CDROM ExamplesUpSDL Reference
\ No newline at end of file diff --git a/docs/html/guidevideo.html b/docs/html/guidevideo.html new file mode 100644 index 0000000..85da77d --- /dev/null +++ b/docs/html/guidevideo.html @@ -0,0 +1,463 @@ +Graphics and Video
SDL Library Documentation
PrevNext

Chapter 2. Graphics and Video

Introduction to SDL Video

Video is probably the most common thing that SDL is used for, and +so it has the most complete subsystem. Here are a few +examples to demonstrate the basics.

Initializing the Video Display

This is what almost all SDL programs have to do in one way or +another.

Example 2-1. Initializing the Video Display

    SDL_Surface *screen;
+
+    /* Initialize the SDL library */
+    if( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
+        fprintf(stderr,
+                "Couldn't initialize SDL: %s\n", SDL_GetError());
+        exit(1);
+    }
+
+    /* Clean up on exit */
+    atexit(SDL_Quit);
+    
+    /*
+     * Initialize the display in a 640x480 8-bit palettized mode,
+     * requesting a software surface
+     */
+    screen = SDL_SetVideoMode(640, 480, 8, SDL_SWSURFACE);
+    if ( screen == NULL ) {
+        fprintf(stderr, "Couldn't set 640x480x8 video mode: %s\n",
+                        SDL_GetError());
+        exit(1);
+    }

Initializing the Best Video Mode

If you have a preference for a certain pixel depth but will accept any +other, use SDL_SetVideoMode with SDL_ANYFORMAT as below. You can also +use SDL_VideoModeOK() to find the native video mode that is closest to +the mode you request.

Example 2-2. Initializing the Best Video Mode

    /* Have a preference for 8-bit, but accept any depth */
+    screen = SDL_SetVideoMode(640, 480, 8, SDL_SWSURFACE|SDL_ANYFORMAT);
+    if ( screen == NULL ) {
+        fprintf(stderr, "Couldn't set 640x480x8 video mode: %s\n",
+                        SDL_GetError());
+        exit(1);
+    }
+    printf("Set 640x480 at %d bits-per-pixel mode\n",
+           screen->format->BitsPerPixel);

Loading and Displaying a BMP File

The following function loads and displays a BMP file given as +argument, once SDL is initialised and a video mode has been set.

Example 2-3. Loading and Displaying a BMP File

void display_bmp(char *file_name)
+{
+    SDL_Surface *image;
+
+    /* Load the BMP file into a surface */
+    image = SDL_LoadBMP(file_name);
+    if (image == NULL) {
+        fprintf(stderr, "Couldn't load %s: %s\n", file_name, SDL_GetError());
+        return;
+    }
+
+    /*
+     * Palettized screen modes will have a default palette (a standard
+     * 8*8*4 colour cube), but if the image is palettized as well we can
+     * use that palette for a nicer colour matching
+     */
+    if (image->format->palette && screen->format->palette) {
+    SDL_SetColors(screen, image->format->palette->colors, 0,
+                  image->format->palette->ncolors);
+    }
+
+    /* Blit onto the screen surface */
+    if(SDL_BlitSurface(image, NULL, screen, NULL) < 0)
+        fprintf(stderr, "BlitSurface error: %s\n", SDL_GetError());
+
+    SDL_UpdateRect(screen, 0, 0, image->w, image->h);
+
+    /* Free the allocated BMP surface */
+    SDL_FreeSurface(image);
+}

Drawing Directly to the Display

The following two functions can be used to get and set single +pixels of a surface. They are carefully written to work with any depth +currently supported by SDL. Remember to lock the surface before +calling them, and to unlock it before calling any other SDL +functions.

To convert between pixel values and their red, green, blue +components, use SDL_GetRGB() and SDL_MapRGB().

Example 2-4. getpixel()

/*
+ * Return the pixel value at (x, y)
+ * NOTE: The surface must be locked before calling this!
+ */
+Uint32 getpixel(SDL_Surface *surface, int x, int y)
+{
+    int bpp = surface->format->BytesPerPixel;
+    /* Here p is the address to the pixel we want to retrieve */
+    Uint8 *p = (Uint8 *)surface->pixels + y * surface->pitch + x * bpp;
+
+    switch(bpp) {
+    case 1:
+        return *p;
+
+    case 2:
+        return *(Uint16 *)p;
+
+    case 3:
+        if(SDL_BYTEORDER == SDL_BIG_ENDIAN)
+            return p[0] << 16 | p[1] << 8 | p[2];
+        else
+            return p[0] | p[1] << 8 | p[2] << 16;
+
+    case 4:
+        return *(Uint32 *)p;
+
+    default:
+        return 0;       /* shouldn't happen, but avoids warnings */
+    }
+}

Example 2-5. putpixel()

/*
+ * Set the pixel at (x, y) to the given value
+ * NOTE: The surface must be locked before calling this!
+ */
+void putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel)
+{
+    int bpp = surface->format->BytesPerPixel;
+    /* Here p is the address to the pixel we want to set */
+    Uint8 *p = (Uint8 *)surface->pixels + y * surface->pitch + x * bpp;
+
+    switch(bpp) {
+    case 1:
+        *p = pixel;
+        break;
+
+    case 2:
+        *(Uint16 *)p = pixel;
+        break;
+
+    case 3:
+        if(SDL_BYTEORDER == SDL_BIG_ENDIAN) {
+            p[0] = (pixel >> 16) & 0xff;
+            p[1] = (pixel >> 8) & 0xff;
+            p[2] = pixel & 0xff;
+        } else {
+            p[0] = pixel & 0xff;
+            p[1] = (pixel >> 8) & 0xff;
+            p[2] = (pixel >> 16) & 0xff;
+        }
+        break;
+
+    case 4:
+        *(Uint32 *)p = pixel;
+        break;
+    }
+}

The following code uses the putpixel() function above to set a +yellow pixel in the middle of the screen.

Example 2-6. Using putpixel()


    /* Code to set a yellow pixel at the center of the screen */
+
+    int x, y;
+    Uint32 yellow;
+
+    /* Map the color yellow to this display (R=0xff, G=0xFF, B=0x00)
+       Note:  If the display is palettized, you must set the palette first.
+    */
+    yellow = SDL_MapRGB(screen->format, 0xff, 0xff, 0x00);
+
+    x = screen->w / 2;
+    y = screen->h / 2;
+
+    /* Lock the screen for direct access to the pixels */
+    if ( SDL_MUSTLOCK(screen) ) {
+        if ( SDL_LockSurface(screen) < 0 ) {
+            fprintf(stderr, "Can't lock screen: %s\n", SDL_GetError());
+            return;
+        }
+    }
+
+    putpixel(screen, x, y, yellow);
+
+    if ( SDL_MUSTLOCK(screen) ) {
+        SDL_UnlockSurface(screen);
+    }
+    /* Update just the part of the display that we've changed */
+    SDL_UpdateRect(screen, x, y, 1, 1);
+
+    return;

PrevHomeNext
Initializing SDLUpUsing OpenGL With SDL
\ No newline at end of file diff --git a/docs/html/guidevideoopengl.html b/docs/html/guidevideoopengl.html new file mode 100644 index 0000000..0abd567 --- /dev/null +++ b/docs/html/guidevideoopengl.html @@ -0,0 +1,730 @@ +Using OpenGL With SDL
SDL Library Documentation
PrevChapter 2. Graphics and VideoNext

Using OpenGL With SDL

SDL has the ability to create and use OpenGL contexts on several platforms(Linux/X11, Win32, BeOS, MacOS Classic/Toolbox, Mac OS X, FreeBSD/X11 and Solaris/X11). This allows you to use SDL's audio, event handling, threads and times in your OpenGL applications (a function often performed by GLUT).

Initialisation

Initialising SDL to use OpenGL is not very different to initialising SDL normally. There are three differences; you must pass SDL_OPENGL to SDL_SetVideoMode, you must specify several GL attributes (depth buffer size, framebuffer sizes) using SDL_GL_SetAttribute and finally, if you wish to use double buffering you must specify it as a GL attribute, not by passing the SDL_DOUBLEBUF flag to SDL_SetVideoMode.

Example 2-7. Initializing SDL with OpenGL

    /* Information about the current video settings. */
+    const SDL_VideoInfo* info = NULL;
+    /* Dimensions of our window. */
+    int width = 0;
+    int height = 0;
+    /* Color depth in bits of our window. */
+    int bpp = 0;
+    /* Flags we will pass into SDL_SetVideoMode. */
+    int flags = 0;
+
+    /* First, initialize SDL's video subsystem. */
+    if( SDL_Init( SDL_INIT_VIDEO ) < 0 ) {
+        /* Failed, exit. */
+        fprintf( stderr, "Video initialization failed: %s\n",
+             SDL_GetError( ) );
+        quit_tutorial( 1 );
+    }
+
+    /* Let's get some video information. */
+    info = SDL_GetVideoInfo( );
+
+    if( !info ) {
+        /* This should probably never happen. */
+        fprintf( stderr, "Video query failed: %s\n",
+             SDL_GetError( ) );
+        quit_tutorial( 1 );
+    }
+
+    /*
+     * Set our width/height to 640/480 (you would
+     * of course let the user decide this in a normal
+     * app). We get the bpp we will request from
+     * the display. On X11, VidMode can't change
+     * resolution, so this is probably being overly
+     * safe. Under Win32, ChangeDisplaySettings
+     * can change the bpp.
+     */
+    width = 640;
+    height = 480;
+    bpp = info->vfmt->BitsPerPixel;
+
+    /*
+     * Now, we want to setup our requested
+     * window attributes for our OpenGL window.
+     * We want *at least* 5 bits of red, green
+     * and blue. We also want at least a 16-bit
+     * depth buffer.
+     *
+     * The last thing we do is request a double
+     * buffered window. '1' turns on double
+     * buffering, '0' turns it off.
+     *
+     * Note that we do not use SDL_DOUBLEBUF in
+     * the flags to SDL_SetVideoMode. That does
+     * not affect the GL attribute state, only
+     * the standard 2D blitting setup.
+     */
+    SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
+    SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
+    SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
+    SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
+    SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
+
+    /*
+     * We want to request that SDL provide us
+     * with an OpenGL window, in a fullscreen
+     * video mode.
+     *
+     * EXERCISE:
+     * Make starting windowed an option, and
+     * handle the resize events properly with
+     * glViewport.
+     */
+    flags = SDL_OPENGL | SDL_FULLSCREEN;
+
+    /*
+     * Set the video mode
+     */
+    if( SDL_SetVideoMode( width, height, bpp, flags ) == 0 ) {
+        /* 
+         * This could happen for a variety of reasons,
+         * including DISPLAY not being set, the specified
+         * resolution not being available, etc.
+         */
+        fprintf( stderr, "Video mode set failed: %s\n",
+             SDL_GetError( ) );
+        quit_tutorial( 1 );
+    }

Drawing

Apart from initialisation, using OpenGL within SDL is the same as using OpenGL +with any other API, e.g. GLUT. You still use all the same function calls and +data types. However if you are using a double-buffered display, then you must +use +SDL_GL_SwapBuffers() +to swap the buffers and update the display. To request double-buffering +with OpenGL, use +SDL_GL_SetAttribute +with SDL_GL_DOUBLEBUFFER, and use +SDL_GL_GetAttribute +to see if you actually got it.

A full example code listing is now presented below.

Example 2-8. SDL and OpenGL

/*
+ * SDL OpenGL Tutorial.
+ * (c) Michael Vance, 2000
+ * briareos@lokigames.com
+ *
+ * Distributed under terms of the LGPL. 
+ */
+
+#include <SDL/SDL.h>
+#include <GL/gl.h>
+#include <GL/glu.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+static GLboolean should_rotate = GL_TRUE;
+
+static void quit_tutorial( int code )
+{
+    /*
+     * Quit SDL so we can release the fullscreen
+     * mode and restore the previous video settings,
+     * etc.
+     */
+    SDL_Quit( );
+
+    /* Exit program. */
+    exit( code );
+}
+
+static void handle_key_down( SDL_keysym* keysym )
+{
+
+    /* 
+     * We're only interested if 'Esc' has
+     * been presssed.
+     *
+     * EXERCISE: 
+     * Handle the arrow keys and have that change the
+     * viewing position/angle.
+     */
+    switch( keysym->sym ) {
+    case SDLK_ESCAPE:
+        quit_tutorial( 0 );
+        break;
+    case SDLK_SPACE:
+        should_rotate = !should_rotate;
+        break;
+    default:
+        break;
+    }
+
+}
+
+static void process_events( void )
+{
+    /* Our SDL event placeholder. */
+    SDL_Event event;
+
+    /* Grab all the events off the queue. */
+    while( SDL_PollEvent( &event ) ) {
+
+        switch( event.type ) {
+        case SDL_KEYDOWN:
+            /* Handle key presses. */
+            handle_key_down( &event.key.keysym );
+            break;
+        case SDL_QUIT:
+            /* Handle quit requests (like Ctrl-c). */
+            quit_tutorial( 0 );
+            break;
+        }
+
+    }
+
+}
+
+static void draw_screen( void )
+{
+    /* Our angle of rotation. */
+    static float angle = 0.0f;
+
+    /*
+     * EXERCISE:
+     * Replace this awful mess with vertex
+     * arrays and a call to glDrawElements.
+     *
+     * EXERCISE:
+     * After completing the above, change
+     * it to use compiled vertex arrays.
+     *
+     * EXERCISE:
+     * Verify my windings are correct here ;).
+     */
+    static GLfloat v0[] = { -1.0f, -1.0f,  1.0f };
+    static GLfloat v1[] = {  1.0f, -1.0f,  1.0f };
+    static GLfloat v2[] = {  1.0f,  1.0f,  1.0f };
+    static GLfloat v3[] = { -1.0f,  1.0f,  1.0f };
+    static GLfloat v4[] = { -1.0f, -1.0f, -1.0f };
+    static GLfloat v5[] = {  1.0f, -1.0f, -1.0f };
+    static GLfloat v6[] = {  1.0f,  1.0f, -1.0f };
+    static GLfloat v7[] = { -1.0f,  1.0f, -1.0f };
+    static GLubyte red[]    = { 255,   0,   0, 255 };
+    static GLubyte green[]  = {   0, 255,   0, 255 };
+    static GLubyte blue[]   = {   0,   0, 255, 255 };
+    static GLubyte white[]  = { 255, 255, 255, 255 };
+    static GLubyte yellow[] = {   0, 255, 255, 255 };
+    static GLubyte black[]  = {   0,   0,   0, 255 };
+    static GLubyte orange[] = { 255, 255,   0, 255 };
+    static GLubyte purple[] = { 255,   0, 255,   0 };
+
+    /* Clear the color and depth buffers. */
+    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+
+    /* We don't want to modify the projection matrix. */
+    glMatrixMode( GL_MODELVIEW );
+    glLoadIdentity( );
+
+    /* Move down the z-axis. */
+    glTranslatef( 0.0, 0.0, -5.0 );
+
+    /* Rotate. */
+    glRotatef( angle, 0.0, 1.0, 0.0 );
+
+    if( should_rotate ) {
+
+        if( ++angle > 360.0f ) {
+            angle = 0.0f;
+        }
+
+    }
+
+    /* Send our triangle data to the pipeline. */
+    glBegin( GL_TRIANGLES );
+
+    glColor4ubv( red );
+    glVertex3fv( v0 );
+    glColor4ubv( green );
+    glVertex3fv( v1 );
+    glColor4ubv( blue );
+    glVertex3fv( v2 );
+
+    glColor4ubv( red );
+    glVertex3fv( v0 );
+    glColor4ubv( blue );
+    glVertex3fv( v2 );
+    glColor4ubv( white );
+    glVertex3fv( v3 );
+
+    glColor4ubv( green );
+    glVertex3fv( v1 );
+    glColor4ubv( black );
+    glVertex3fv( v5 );
+    glColor4ubv( orange );
+    glVertex3fv( v6 );
+
+    glColor4ubv( green );
+    glVertex3fv( v1 );
+    glColor4ubv( orange );
+    glVertex3fv( v6 );
+    glColor4ubv( blue );
+    glVertex3fv( v2 );
+
+    glColor4ubv( black );
+    glVertex3fv( v5 );
+    glColor4ubv( yellow );
+    glVertex3fv( v4 );
+    glColor4ubv( purple );
+    glVertex3fv( v7 );
+
+    glColor4ubv( black );
+    glVertex3fv( v5 );
+    glColor4ubv( purple );
+    glVertex3fv( v7 );
+    glColor4ubv( orange );
+    glVertex3fv( v6 );
+
+    glColor4ubv( yellow );
+    glVertex3fv( v4 );
+    glColor4ubv( red );
+    glVertex3fv( v0 );
+    glColor4ubv( white );
+    glVertex3fv( v3 );
+
+    glColor4ubv( yellow );
+    glVertex3fv( v4 );
+    glColor4ubv( white );
+    glVertex3fv( v3 );
+    glColor4ubv( purple );
+    glVertex3fv( v7 );
+
+    glColor4ubv( white );
+    glVertex3fv( v3 );
+    glColor4ubv( blue );
+    glVertex3fv( v2 );
+    glColor4ubv( orange );
+    glVertex3fv( v6 );
+
+    glColor4ubv( white );
+    glVertex3fv( v3 );
+    glColor4ubv( orange );
+    glVertex3fv( v6 );
+    glColor4ubv( purple );
+    glVertex3fv( v7 );
+
+    glColor4ubv( green );
+    glVertex3fv( v1 );
+    glColor4ubv( red );
+    glVertex3fv( v0 );
+    glColor4ubv( yellow );
+    glVertex3fv( v4 );
+
+    glColor4ubv( green );
+    glVertex3fv( v1 );
+    glColor4ubv( yellow );
+    glVertex3fv( v4 );
+    glColor4ubv( black );
+    glVertex3fv( v5 );
+
+    glEnd( );
+
+    /*
+     * EXERCISE:
+     * Draw text telling the user that 'Spc'
+     * pauses the rotation and 'Esc' quits.
+     * Do it using vetors and textured quads.
+     */
+
+    /*
+     * Swap the buffers. This this tells the driver to
+     * render the next frame from the contents of the
+     * back-buffer, and to set all rendering operations
+     * to occur on what was the front-buffer.
+     *
+     * Double buffering prevents nasty visual tearing
+     * from the application drawing on areas of the
+     * screen that are being updated at the same time.
+     */
+    SDL_GL_SwapBuffers( );
+}
+
+static void setup_opengl( int width, int height )
+{
+    float ratio = (float) width / (float) height;
+
+    /* Our shading model--Gouraud (smooth). */
+    glShadeModel( GL_SMOOTH );
+
+    /* Culling. */
+    glCullFace( GL_BACK );
+    glFrontFace( GL_CCW );
+    glEnable( GL_CULL_FACE );
+
+    /* Set the clear color. */
+    glClearColor( 0, 0, 0, 0 );
+
+    /* Setup our viewport. */
+    glViewport( 0, 0, width, height );
+
+    /*
+     * Change to the projection matrix and set
+     * our viewing volume.
+     */
+    glMatrixMode( GL_PROJECTION );
+    glLoadIdentity( );
+    /*
+     * EXERCISE:
+     * Replace this with a call to glFrustum.
+     */
+    gluPerspective( 60.0, ratio, 1.0, 1024.0 );
+}
+
+int main( int argc, char* argv[] )
+{
+    /* Information about the current video settings. */
+    const SDL_VideoInfo* info = NULL;
+    /* Dimensions of our window. */
+    int width = 0;
+    int height = 0;
+    /* Color depth in bits of our window. */
+    int bpp = 0;
+    /* Flags we will pass into SDL_SetVideoMode. */
+    int flags = 0;
+
+    /* First, initialize SDL's video subsystem. */
+    if( SDL_Init( SDL_INIT_VIDEO ) < 0 ) {
+        /* Failed, exit. */
+        fprintf( stderr, "Video initialization failed: %s\n",
+             SDL_GetError( ) );
+        quit_tutorial( 1 );
+    }
+
+    /* Let's get some video information. */
+    info = SDL_GetVideoInfo( );
+
+    if( !info ) {
+        /* This should probably never happen. */
+        fprintf( stderr, "Video query failed: %s\n",
+             SDL_GetError( ) );
+        quit_tutorial( 1 );
+    }
+
+    /*
+     * Set our width/height to 640/480 (you would
+     * of course let the user decide this in a normal
+     * app). We get the bpp we will request from
+     * the display. On X11, VidMode can't change
+     * resolution, so this is probably being overly
+     * safe. Under Win32, ChangeDisplaySettings
+     * can change the bpp.
+     */
+    width = 640;
+    height = 480;
+    bpp = info->vfmt->BitsPerPixel;
+
+    /*
+     * Now, we want to setup our requested
+     * window attributes for our OpenGL window.
+     * We want *at least* 5 bits of red, green
+     * and blue. We also want at least a 16-bit
+     * depth buffer.
+     *
+     * The last thing we do is request a double
+     * buffered window. '1' turns on double
+     * buffering, '0' turns it off.
+     *
+     * Note that we do not use SDL_DOUBLEBUF in
+     * the flags to SDL_SetVideoMode. That does
+     * not affect the GL attribute state, only
+     * the standard 2D blitting setup.
+     */
+    SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
+    SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
+    SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
+    SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
+    SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
+
+    /*
+     * We want to request that SDL provide us
+     * with an OpenGL window, in a fullscreen
+     * video mode.
+     *
+     * EXERCISE:
+     * Make starting windowed an option, and
+     * handle the resize events properly with
+     * glViewport.
+     */
+    flags = SDL_OPENGL | SDL_FULLSCREEN;
+
+    /*
+     * Set the video mode
+     */
+    if( SDL_SetVideoMode( width, height, bpp, flags ) == 0 ) {
+        /* 
+         * This could happen for a variety of reasons,
+         * including DISPLAY not being set, the specified
+         * resolution not being available, etc.
+         */
+        fprintf( stderr, "Video mode set failed: %s\n",
+             SDL_GetError( ) );
+        quit_tutorial( 1 );
+    }
+
+    /*
+     * At this point, we should have a properly setup
+     * double-buffered window for use with OpenGL.
+     */
+    setup_opengl( width, height );
+
+    /*
+     * Now we want to begin our normal app process--
+     * an event loop with a lot of redrawing.
+     */
+    while( 1 ) {
+        /* Process incoming events. */
+        process_events( );
+        /* Draw the screen. */
+        draw_screen( );
+    }
+
+    /*
+     * EXERCISE:
+     * Record timings using SDL_GetTicks() and
+     * and print out frames per second at program
+     * end.
+     */
+
+    /* Never reached. */
+    return 0;
+}

PrevHomeNext
Graphics and VideoUpInput handling
\ No newline at end of file diff --git a/docs/html/index.html b/docs/html/index.html new file mode 100644 index 0000000..f86ff19 --- /dev/null +++ b/docs/html/index.html @@ -0,0 +1,1156 @@ +
Table of Contents
I. SDL Guide
Preface
About SDL
About SDLdoc
Credits
1. The Basics
Introduction
Initializing SDL
2. Graphics and Video
Introduction to SDL Video
Using OpenGL With SDL
3. Input handling
Handling Joysticks
Handling the Keyboard
4. Examples
Introduction
Event Examples
Audio Examples
CDROM Examples
Time Examples
II. SDL Reference
5. General
SDL_Init -- Initializes SDL
SDL_InitSubSystem -- Initialize subsystems
SDL_QuitSubSystem -- Shut down a subsystem
SDL_Quit -- Shut down SDL
SDL_WasInit -- Check which subsystems are initialized
SDL_GetError -- Get SDL error string
SDL_envvars -- SDL environment variables
6. Video
SDL_GetVideoSurface -- returns a pointer to the current display surface
SDL_GetVideoInfo -- returns a pointer to information about the video hardware
SDL_VideoDriverName -- Obtain the name of the video driver
SDL_ListModes -- Returns a pointer to an array of available screen dimensions for +the given format and video flags
SDL_VideoModeOK -- Check to see if a particular video mode is supported.
SDL_SetVideoMode -- Set up a video mode with the specified width, height and bits-per-pixel.
SDL_UpdateRect -- Makes sure the given area is updated on the given screen.
SDL_UpdateRects -- Makes sure the given list of rectangles is updated on the given screen.
SDL_Flip -- Swaps screen buffers
SDL_SetColors -- Sets a portion of the colormap for the given 8-bit surface.
SDL_SetPalette -- Sets the colors in the palette of an 8-bit surface.
SDL_SetGamma -- Sets the color gamma function for the display
SDL_GetGammaRamp -- Gets the color gamma lookup tables for the display
SDL_SetGammaRamp -- Sets the color gamma lookup tables for the display
SDL_MapRGB -- Map a RGB color value to a pixel format.
SDL_MapRGBA -- Map a RGBA color value to a pixel format.
SDL_GetRGB -- Get RGB values from a pixel in the specified pixel format.
SDL_GetRGBA -- Get RGBA values from a pixel in the specified pixel format.
SDL_CreateRGBSurface -- Create an empty SDL_Surface
SDL_CreateRGBSurfaceFrom -- Create an SDL_Surface from pixel data
SDL_FreeSurface -- Frees (deletes) a SDL_Surface
SDL_LockSurface -- Lock a surface for directly access.
SDL_UnlockSurface -- Unlocks a previously locked surface.
SDL_LoadBMP -- Load a Windows BMP file into an SDL_Surface.
SDL_SaveBMP -- Save an SDL_Surface as a Windows BMP file.
SDL_SetColorKey -- Sets the color key (transparent pixel) in a blittable surface and +RLE acceleration.
SDL_SetAlpha -- Adjust the alpha properties of a surface
SDL_SetClipRect -- Sets the clipping rectangle for a surface.
SDL_GetClipRect -- Gets the clipping rectangle for a surface.
SDL_ConvertSurface -- Converts a surface to the same format as another surface.
SDL_BlitSurface -- This performs a fast blit from the source surface to the destination surface.
SDL_FillRect -- This function performs a fast fill of the given rectangle with some color
SDL_DisplayFormat -- Convert a surface to the display format
SDL_DisplayFormatAlpha -- Convert a surface to the display format
SDL_WarpMouse -- Set the position of the mouse cursor.
SDL_CreateCursor -- Creates a new mouse cursor.
SDL_FreeCursor -- Frees a cursor created with SDL_CreateCursor.
SDL_SetCursor -- Set the currently active mouse cursor.
SDL_GetCursor -- Get the currently active mouse cursor.
SDL_ShowCursor -- Toggle whether or not the cursor is shown on the screen.
SDL_GL_LoadLibrary -- Specify an OpenGL library
SDL_GL_GetProcAddress -- Get the address of a GL function
SDL_GL_GetAttribute -- Get the value of a special SDL/OpenGL attribute
SDL_GL_SetAttribute -- Set a special SDL/OpenGL attribute
SDL_GL_SwapBuffers -- Swap OpenGL framebuffers/Update Display
SDL_CreateYUVOverlay -- Create a YUV video overlay
SDL_LockYUVOverlay -- Lock an overlay
SDL_UnlockYUVOverlay -- Unlock an overlay
SDL_DisplayYUVOverlay -- Blit the overlay to the display
SDL_FreeYUVOverlay -- Free a YUV video overlay
SDL_GLattr -- SDL GL Attributes
SDL_Rect -- Defines a rectangular area
SDL_Color -- Format independent color description
SDL_Palette -- Color palette for 8-bit pixel formats
SDL_PixelFormat -- Stores surface format information
SDL_Surface -- Graphical Surface Structure
SDL_VideoInfo -- Video Target information
SDL_Overlay -- YUV video overlay
7. Window Management
SDL_WM_SetCaption -- Sets the window tile and icon name.
SDL_WM_GetCaption -- Gets the window title and icon name.
SDL_WM_SetIcon -- Sets the icon for the display window.
SDL_WM_IconifyWindow -- Iconify/Minimise the window
SDL_WM_ToggleFullScreen -- Toggles fullscreen mode
SDL_WM_GrabInput -- Grabs mouse and keyboard input.
8. Events
Introduction
SDL Event Structures.
Event Functions.
9. Joystick
SDL_NumJoysticks -- Count available joysticks.
SDL_JoystickName -- Get joystick name.
SDL_JoystickOpen -- Opens a joystick for use.
SDL_JoystickOpened -- Determine if a joystick has been opened
SDL_JoystickIndex -- Get the index of an SDL_Joystick.
SDL_JoystickNumAxes -- Get the number of joystick axes
SDL_JoystickNumBalls -- Get the number of joystick trackballs
SDL_JoystickNumHats -- Get the number of joystick hats
SDL_JoystickNumButtons -- Get the number of joysitck buttons
SDL_JoystickUpdate -- Updates the state of all joysticks
SDL_JoystickGetAxis -- Get the current state of an axis
SDL_JoystickGetHat -- Get the current state of a joystick hat
SDL_JoystickGetButton -- Get the current state of a given button on a given joystick
SDL_JoystickGetBall -- Get relative trackball motion
SDL_JoystickClose -- Closes a previously opened joystick
10. Audio
SDL_AudioSpec -- Audio Specification Structure
SDL_OpenAudio -- Opens the audio device with the desired parameters.
SDL_PauseAudio -- Pauses and unpauses the audio callback processing
SDL_GetAudioStatus -- Get the current audio state
SDL_LoadWAV -- Load a WAVE file
SDL_FreeWAV -- Frees previously opened WAV data
SDL_AudioCVT -- Audio Conversion Structure
SDL_BuildAudioCVT -- Initializes a SDL_AudioCVT structure for conversion
SDL_ConvertAudio -- Convert audio data to a desired audio format.
SDL_MixAudio -- Mix audio data
SDL_LockAudio -- Lock out the callback function
SDL_UnlockAudio -- Unlock the callback function
SDL_CloseAudio -- Shuts down audio processing and closes the audio device.
11. CD-ROM
SDL_CDNumDrives -- Returns the number of CD-ROM drives on the system.
SDL_CDName -- Returns a human-readable, system-dependent identifier for the CD-ROM.
SDL_CDOpen -- Opens a CD-ROM drive for access.
SDL_CDStatus -- Returns the current status of the given drive.
SDL_CDPlay -- Play a CD
SDL_CDPlayTracks -- Play the given CD track(s)
SDL_CDPause -- Pauses a CDROM
SDL_CDResume -- Resumes a CDROM
SDL_CDStop -- Stops a CDROM
SDL_CDEject -- Ejects a CDROM
SDL_CDClose -- Closes a SDL_CD handle
SDL_CD -- CDROM Drive Information
SDL_CDtrack -- CD Track Information Structure
12. Multi-threaded Programming
SDL_CreateThread -- Creates a new thread of execution that shares its parent's properties.
SDL_ThreadID -- Get the 32-bit thread identifier for the current thread.
SDL_GetThreadID -- Get the SDL thread ID of a SDL_Thread
SDL_WaitThread -- Wait for a thread to finish.
SDL_KillThread -- Gracelessly terminates the thread.
SDL_CreateMutex -- Create a mutex
SDL_DestroyMutex -- Destroy a mutex
SDL_mutexP -- Lock a mutex
SDL_mutexV -- Unlock a mutex
SDL_CreateSemaphore -- Creates a new semaphore and assigns an initial value to it.
SDL_DestroySemaphore -- Destroys a semaphore that was created by SDL_CreateSemaphore.
SDL_SemWait -- Lock a semaphore and suspend the thread if the semaphore value is zero.
SDL_SemTryWait -- Attempt to lock a semaphore but don't suspend the thread.
SDL_SemWaitTimeout -- Lock a semaphore, but only wait up to a specified maximum time.
SDL_SemPost -- Unlock a semaphore.
SDL_SemValue -- Return the current value of a semaphore.
SDL_CreateCond -- Create a condition variable
SDL_DestroyCond -- Destroy a condition variable
SDL_CondSignal -- Restart a thread wait on a condition variable
SDL_CondBroadcast -- Restart all threads waiting on a condition variable
SDL_CondWait -- Wait on a condition variable
SDL_CondWaitTimeout -- Wait on a condition variable, with timeout
13. Time
SDL_GetTicks -- Get the number of milliseconds since the SDL library initialization.
SDL_Delay -- Wait a specified number of milliseconds before returning.
SDL_AddTimer -- Add a timer which will call a callback after the specified number of milliseconds has +elapsed.
SDL_RemoveTimer -- Remove a timer which was added with +SDL_AddTimer.
SDL_SetTimer -- Set a callback to run after the specified number of milliseconds has +elapsed.

  Next
  SDL Guide
\ No newline at end of file diff --git a/docs/html/joystick.html b/docs/html/joystick.html new file mode 100644 index 0000000..abdb28c --- /dev/null +++ b/docs/html/joystick.html @@ -0,0 +1,296 @@ +Joystick
SDL Library Documentation
PrevNext

Chapter 9. Joystick

Table of Contents
SDL_NumJoysticks -- Count available joysticks.
SDL_JoystickName -- Get joystick name.
SDL_JoystickOpen -- Opens a joystick for use.
SDL_JoystickOpened -- Determine if a joystick has been opened
SDL_JoystickIndex -- Get the index of an SDL_Joystick.
SDL_JoystickNumAxes -- Get the number of joystick axes
SDL_JoystickNumBalls -- Get the number of joystick trackballs
SDL_JoystickNumHats -- Get the number of joystick hats
SDL_JoystickNumButtons -- Get the number of joysitck buttons
SDL_JoystickUpdate -- Updates the state of all joysticks
SDL_JoystickGetAxis -- Get the current state of an axis
SDL_JoystickGetHat -- Get the current state of a joystick hat
SDL_JoystickGetButton -- Get the current state of a given button on a given joystick
SDL_JoystickGetBall -- Get relative trackball motion
SDL_JoystickClose -- Closes a previously opened joystick

Joysticks, and other similar input devices, have a very strong role in game playing and SDL provides comprehensive support for them. Axes, Buttons, POV Hats and trackballs are all supported.

Joystick support is initialized by passed the SDL_INIT_JOYSTICK flag to SDL_Init. Once initilized joysticks must be opened using SDL_JoystickOpen.

While using the functions describe in this secton may seem like the best way to access and read from joysticks, in most cases they aren't. Ideally joysticks should be read using the event system. To enable this, you must set the joystick event processing state with SDL_JoystickEventState. Joysticks must be opened before they can be used of course.

Note: If you are not handling the joystick via the event queue then you must explicitly request a joystick update by calling SDL_JoystickUpdate.

Note: Force Feedback is not yet support. Sam (slouken@libsdl.org) is soliciting suggestions from people with force-feedback experience on the best wat to desgin the API.


PrevHomeNext
SDL_JoystickEventStateUpSDL_NumJoysticks
\ No newline at end of file diff --git a/docs/html/reference.html b/docs/html/reference.html new file mode 100644 index 0000000..e7707a7 --- /dev/null +++ b/docs/html/reference.html @@ -0,0 +1,194 @@ +SDL Reference
SDL Library Documentation
PrevNext

II. SDL Reference


PrevHomeNext
Time Examples General
\ No newline at end of file diff --git a/docs/html/sdlactiveevent.html b/docs/html/sdlactiveevent.html new file mode 100644 index 0000000..d3f2821 --- /dev/null +++ b/docs/html/sdlactiveevent.html @@ -0,0 +1,335 @@ +SDL_ActiveEvent
SDL Library Documentation
PrevNext

SDL_ActiveEvent

Name

SDL_ActiveEvent -- Application visibility event structure

Structure Definition

typedef struct{
+  Uint8 type;
+  Uint8 gain;
+  Uint8 state;
+} SDL_ActiveEvent;

Structure Data

typeSDL_ACTIVEEVENT.
gain0 if the event is a loss or 1 if it is a gain.
stateSDL_APPMOUSEFOCUS if mouse focus was gained or lost, SDL_APPINPUTFOCUS if input focus was gained or lost, or SDL_APPACTIVE if the application was iconified (gain=0) or restored(gain=1).

Description

SDL_ActiveEvent is a member of the SDL_Event union and is used when an event of type SDL_ACTIVEEVENT is reported.

When the mouse leaves or enters the window area a SDL_APPMOUSEFOCUS type activation event occurs, if the mouse entered the window then gain will be 1, otherwise gain will be 0. A SDL_APPINPUTFOCUS type activation event occurs when the application loses or gains keyboard focus. This usually occurs when another application is made active. Finally, a SDL_APPACTIVE type event occurs when the application is either minimised/iconified (gain=0) or restored.

Note: This event does not occur when an application window is first created.


PrevHomeNext
SDL_EventUpSDL_KeyboardEvent
\ No newline at end of file diff --git a/docs/html/sdladdtimer.html b/docs/html/sdladdtimer.html new file mode 100644 index 0000000..81c49e5 --- /dev/null +++ b/docs/html/sdladdtimer.html @@ -0,0 +1,296 @@ +SDL_AddTimer
SDL Library Documentation
PrevNext

SDL_AddTimer

Name

SDL_AddTimer -- Add a timer which will call a callback after the specified number of milliseconds has +elapsed.

Synopsis

#include "SDL.h"

SDL_TimerID SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param);

Callback

/* type definition for the "new" timer callback function */
+typedef Uint32 (*SDL_NewTimerCallback)(Uint32 interval, void *param);

Description

Adds a callback function to be run after the specified number of +milliseconds has elapsed. The callback function is passed the current +timer interval and the user supplied parameter from the +SDL_AddTimer call and returns the next timer +interval. If the returned value from the callback is the same as the one +passed in, the periodic alarm continues, otherwise a new alarm is +scheduled.

To cancel a currently running timer call +SDL_RemoveTimer with the +timer ID returned from +SDL_AddTimer.

The timer callback function may run in a different thread than your +main program, and so shouldn't call any functions from within itself. +You may always call SDL_PushEvent, however.

The granularity of the timer is platform-dependent, but you should count +on it being at least 10 ms as this is the most common number. +This means that if +you request a 16 ms timer, your callback will run approximately 20 ms +later on an unloaded system. If you wanted to set a flag signaling +a frame update at 30 frames per second (every 33 ms), you might set a +timer for 30 ms (see example below). + +If you use this function, you need to pass SDL_INIT_TIMER +to SDL_Init.

Return Value

Returns an ID value for the added timer or +NULL if there was an error.

Examples

my_timer_id = SDL_AddTimer((33/10)*10, my_callbackfunc, my_callback_param);


PrevHomeNext
SDL_DelayUpSDL_RemoveTimer
\ No newline at end of file diff --git a/docs/html/sdlaudiocvt.html b/docs/html/sdlaudiocvt.html new file mode 100644 index 0000000..ff39209 --- /dev/null +++ b/docs/html/sdlaudiocvt.html @@ -0,0 +1,556 @@ +SDL_AudioCVT
SDL Library Documentation
PrevNext

SDL_AudioCVT

Name

SDL_AudioCVT -- Audio Conversion Structure

Structure Definition

typedef struct{
+  int needed;
+  Uint16 src_format;
+  Uint16 dest_format;
+  double rate_incr;
+  Uint8 *buf;
+  int len;
+  int len_cvt;
+  int len_mult;
+  double len_ratio;
+  void (*filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
+  int filter_index;
+} SDL_AudioCVT;

Structure Data

neededSet to one if the conversion is possible
src_formatAudio format of the source
dest_formatAudio format of the destination
rate_incrRate conversion increment
bufAudio buffer
lenLength of the original audio buffer in bytes
len_cvtLength of converted audio buffer in bytes (calculated)
len_multbuf must be len*len_mult bytes in size(calculated)
len_ratioFinal audio size is len*len_ratio
filters[10](..)Pointers to functions needed for this conversion
filter_indexCurrent conversion function

Description

The SDL_AudioCVT is used to convert audio data between different formats. A SDL_AudioCVT structure is created with the SDL_BuildAudioCVT function, while the actual conversion is done by the SDL_ConvertAudio function.

Many of the fields in the SDL_AudioCVT structure should be considered private and their function will not be discussed here.

Uint8 *buf

This points to the audio data that will be used in the conversion. It is both the source and the destination, which means the converted audio data overwrites the original data. It also means that the converted data may be larger than the original data (if you were converting from 8-bit to 16-bit, for instance), so you must ensure buf is large enough. See below.

int len

This is the length of the original audio data in bytes.

int len_mult

As explained above, the audio buffer needs to be big enough to store the converted data, which may be bigger than the original audio data. The length of buf should be len*len_mult.

double len_ratio

When you have finished converting your audio data, you need to know how much of your audio buffer is valid. len*len_ratio is the size of the converted audio data in bytes. This is very similar to len_mult, however when the convert audio data is shorter than the original len_mult would be 1. len_ratio, on the other hand, would be a fractional number between 0 and 1.


PrevHomeNext
SDL_FreeWAVUpSDL_BuildAudioCVT
\ No newline at end of file diff --git a/docs/html/sdlaudiospec.html b/docs/html/sdlaudiospec.html new file mode 100644 index 0000000..fc6fa75 --- /dev/null +++ b/docs/html/sdlaudiospec.html @@ -0,0 +1,589 @@ +SDL_AudioSpec
SDL Library Documentation
PrevNext

SDL_AudioSpec

Name

SDL_AudioSpec -- Audio Specification Structure

Structure Definition

typedef struct{
+  int freq;
+  Uint16 format;
+  Uint8 channels;
+  Uint8 silence;
+  Uint16 samples;
+  Uint32 size;
+  void (*callback)(void *userdata, Uint8 *stream, int len);
+  void *userdata;
+} SDL_AudioSpec;

Structure Data

freqAudio frequency in samples per second
formatAudio data format
channelsNumber of channels: 1 mono, 2 stereo
silenceAudio buffer silence value (calculated)
samplesAudio buffer size in samples
sizeAudio buffer size in bytes (calculated)
callback(..)Callback function for filling the audio buffer
userdataPointer the user data which is passed to the callback function

Description

The SDL_AudioSpec structure is used to describe the format of some audio data. This structure is used by SDL_OpenAudio and SDL_LoadWAV. While all fields are used by SDL_OpenAudio only freq, format, samples and channels are used by SDL_LoadWAV. We will detail these common members here.

freq

The number of samples sent to the sound device every second. Common values are 11025, 22050 and 44100. The higher the better.

format

Specifies the size and type of each sample element +

AUDIO_U8

Unsigned 8-bit samples

AUDIO_S8

Signed 8-bit samples

AUDIO_U16 or AUDIO_U16LSB

Unsigned 16-bit little-endian samples

AUDIO_S16 or AUDIO_S16LSB

Signed 16-bit little-endian samples

AUDIO_U16MSB

Unsigned 16-bit big-endian samples

AUDIO_S16MSB

Signed 16-bit big-endian samples

AUDIO_U16SYS

Either AUDIO_U16LSB or AUDIO_U16MSB depending on you systems endianness

AUDIO_S16SYS

Either AUDIO_S16LSB or AUDIO_S16MSB depending on you systems endianness

channelsThe number of seperate sound channels. 1 is mono (single channel), 2 is stereo (dual channel).
samplesWhen used with SDL_OpenAudio this refers to the size of the audio buffer in samples. A sample a chunk of audio data of the size specified in format mulitplied by the number of channels. When the SDL_AudioSpec is used with SDL_LoadWAV samples is set to 4096.


PrevHomeNext
AudioUpSDL_OpenAudio
\ No newline at end of file diff --git a/docs/html/sdlblitsurface.html b/docs/html/sdlblitsurface.html new file mode 100644 index 0000000..3123ff5 --- /dev/null +++ b/docs/html/sdlblitsurface.html @@ -0,0 +1,339 @@ +SDL_BlitSurface
SDL Library Documentation
PrevNext

SDL_BlitSurface

Name

SDL_BlitSurface -- This performs a fast blit from the source surface to the destination surface.

Synopsis

#include "SDL.h"

int SDL_BlitSurface(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect);

Description

This performs a fast blit from the source surface to the destination surface.

The width and height in srcrect determine the +size of the copied rectangle. Only the position is used in the +dstrect (the width and height are ignored).

If srcrect is NULL, the +entire surface is copied. If dstrect is +NULL, then the destination position (upper left +corner) is (0, 0).

The final blit rectangle is saved in +dstrect after all clipping is performed +(srcrect is not modified).

The blit function should not be called on a locked surface.

The results of blitting operations vary greatly depending on whether SDL_SRCAPLHA is set or not. See SDL_SetAlpha for an explaination of how this affects your results. Colorkeying and alpha attributes also interact with surface blitting, as the following pseudo-code should hopefully explain. +

if (source surface has SDL_SRCALPHA set) {
+    if (source surface has alpha channel (that is, format->Amask != 0))
+        blit using per-pixel alpha, ignoring any colour key
+    else {
+        if (source surface has SDL_SRCCOLORKEY set)
+            blit using the colour key AND the per-surface alpha value
+        else
+            blit using the per-surface alpha value
+    }
+} else {
+    if (source surface has SDL_SRCCOLORKEY set)
+        blit using the colour key
+    else
+        ordinary opaque rectangular blit
+}

Return Value

If the blit is successful, it returns 0, +otherwise it returns -1.

If either of the surfaces were in video memory, and the blit returns +-2, the video memory was lost, so it should be +reloaded with artwork and re-blitted: +

        while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
+                while ( SDL_LockSurface(image)) < 0 )
+                        SDL_Delay(10);
+                -- Write image pixels to image->pixels --
+                SDL_UnlockSurface(image);
+        }
+This happens under DirectX 5.0 when the system switches away from your +fullscreen application. Locking the surface will also fail until you +have access to the video memory again.


PrevHomeNext
SDL_ConvertSurfaceUpSDL_FillRect
\ No newline at end of file diff --git a/docs/html/sdlbuildaudiocvt.html b/docs/html/sdlbuildaudiocvt.html new file mode 100644 index 0000000..2e8420e --- /dev/null +++ b/docs/html/sdlbuildaudiocvt.html @@ -0,0 +1,291 @@ +SDL_BuildAudioCVT
SDL Library Documentation
PrevNext

SDL_BuildAudioCVT

Name

SDL_BuildAudioCVT -- Initializes a SDL_AudioCVT structure for conversion

Synopsis

#include "SDL.h"

int SDL_BuildAudioCVT(SDL_AudioCVT *cvt, Uint16 src_format, Uint8 src_channels, int src_rate, Uint16 dst_format, Uint8 dst_channels, int dst_rate);

Description

Before an SDL_AudioCVT structure can be used to convert audio data it must be initialized with source and destination information.

src_format and dst_format are the source and destination format of the conversion. (For information on audio formats see SDL_AudioSpec). src_channels and dst_channels are the number of channels in the source and destination formats. Finally, src_rate and dst_rate are the frequency or samples-per-second of the source and destination formats. Once again, see SDL_AudioSpec.

Return Values

Returns -1 if the filter could not be built or 1 if it could.

Examples

See SDL_ConvertAudio.


PrevHomeNext
SDL_AudioCVTUpSDL_ConvertAudio
\ No newline at end of file diff --git a/docs/html/sdlcd.html b/docs/html/sdlcd.html new file mode 100644 index 0000000..6f8a7cd --- /dev/null +++ b/docs/html/sdlcd.html @@ -0,0 +1,359 @@ +SDL_CD
SDL Library Documentation
PrevNext

SDL_CD

Name

SDL_CD -- CDROM Drive Information

Structure Definition

typedef struct{
+  int id;
+  CDstatus status;
+  int numtracks;
+  int cur_track;
+  int cur_frame;
+  SDL_CDtrack track[SDL_MAX_TRACKS+1];
+} SDL_CD;

Structure Data

idPrivate drive identifier
statusDrive status
numtracksNumber of tracks on the CD
cur_trackCurrent track
cur_frameCurrent frame offset within the track
track[SDL_MAX_TRACKS+1]Array of track descriptions. (see SDL_CDtrack)

Description

An SDL_CD structure is returned by SDL_CDOpen. It represents an opened CDROM device and stores information on the layout of the tracks on the disc.

A frame is the base data unit of a CD. CD_FPS frames is equal to 1 second of music. SDL provides two macros for converting between time and frames: FRAMES_TO_MSF(f, M,S,F) and MSF_TO_FRAMES.

Examples

int min, sec, frame;
+int frame_offset;
+
+FRAMES_TO_MSF(cdrom->cur_frame, &min, &sec, &frame);
+printf("Current Position: %d minutes, %d seconds, %d frames\n", min, sec, frame);
+
+frame_offset=MSF_TO_FRAMES(min, sec, frame);

PrevHomeNext
SDL_CDCloseUpSDL_CDtrack
\ No newline at end of file diff --git a/docs/html/sdlcdclose.html b/docs/html/sdlcdclose.html new file mode 100644 index 0000000..2a984a8 --- /dev/null +++ b/docs/html/sdlcdclose.html @@ -0,0 +1,217 @@ +SDL_CDClose
SDL Library Documentation
PrevNext

SDL_CDClose

Name

SDL_CDClose -- Closes a SDL_CD handle

Synopsis

#include "SDL.h"

void SDL_CDClose(SDL_CD *cdrom);

Description

Closes the given cdrom handle.

See Also

SDL_CDOpen, +SDL_CD


PrevHomeNext
SDL_CDEjectUpSDL_CD
\ No newline at end of file diff --git a/docs/html/sdlcdeject.html b/docs/html/sdlcdeject.html new file mode 100644 index 0000000..03a3b78 --- /dev/null +++ b/docs/html/sdlcdeject.html @@ -0,0 +1,226 @@ +SDL_CDEject
SDL Library Documentation
PrevNext

SDL_CDEject

Name

SDL_CDEject -- Ejects a CDROM

Synopsis

#include "SDL.h"

int SDL_CDEject(SDL_CD *cdrom);

Description

Ejects the given cdrom.

Return Value

Returns 0 on success, or -1 on an error.

See Also

SDL_CD


PrevHomeNext
SDL_CDStopUpSDL_CDClose
\ No newline at end of file diff --git a/docs/html/sdlcdname.html b/docs/html/sdlcdname.html new file mode 100644 index 0000000..55a18e2 --- /dev/null +++ b/docs/html/sdlcdname.html @@ -0,0 +1,239 @@ +SDL_CDName
SDL Library Documentation
PrevNext

SDL_CDName

Name

SDL_CDName -- Returns a human-readable, system-dependent identifier for the CD-ROM.

Synopsis

#include "SDL.h"

const char *SDL_CDName(int drive);

Description

Returns a human-readable, system-dependent identifier for the CD-ROM. drive is the index of the drive. Drive indices start to 0 and end at SDL_CDNumDrives()-1.

Examples

  • "/dev/cdrom"

  • "E:"

  • "/dev/disk/ide/1/master"


PrevHomeNext
SDL_CDNumDrivesUpSDL_CDOpen
\ No newline at end of file diff --git a/docs/html/sdlcdnumdrives.html b/docs/html/sdlcdnumdrives.html new file mode 100644 index 0000000..9816a73 --- /dev/null +++ b/docs/html/sdlcdnumdrives.html @@ -0,0 +1,205 @@ +SDL_CDNumDrives
SDL Library Documentation
PrevNext

SDL_CDNumDrives

Name

SDL_CDNumDrives -- Returns the number of CD-ROM drives on the system.

Synopsis

#include "SDL.h"

int SDL_CDNumDrives(void);

Description

Returns the number of CD-ROM drives on the system.

See Also

SDL_CDOpen


PrevHomeNext
CD-ROMUpSDL_CDName
\ No newline at end of file diff --git a/docs/html/sdlcdopen.html b/docs/html/sdlcdopen.html new file mode 100644 index 0000000..09a6bd9 --- /dev/null +++ b/docs/html/sdlcdopen.html @@ -0,0 +1,275 @@ +SDL_CDOpen
SDL Library Documentation
PrevNext

SDL_CDOpen

Name

SDL_CDOpen -- Opens a CD-ROM drive for access.

Synopsis

#include "SDL.h"

SDL_CD *SDL_CDOpen(int drive);

Description

Opens a CD-ROM drive for access. It returns a SDL_CD structure on success, or NULL if the drive was invalid or busy. This newly opened CD-ROM becomes the default CD used when other CD functions are passed a NULL CD-ROM handle.

Drives are numbered starting with 0. +Drive 0 is the system default CD-ROM.

Examples

SDL_CD *cdrom;
+int cur_track;
+int min, sec, frame;
+SDL_Init(SDL_INIT_CDROM);
+atexit(SDL_Quit);
+
+/* Check for CD drives */
+if(!SDL_CDNumDrives()){
+  /* None found */
+  fprintf(stderr, "No CDROM devices available\n");
+  exit(-1);
+}
+
+/* Open the default drive */
+cdrom=SDL_CDOpen(0);
+
+/* Did if open? Check if cdrom is NULL */
+if(!cdrom){
+  fprintf(stderr, "Couldn't open drive: %s\n", SDL_GetError());
+  exit(-1);
+}
+
+/* Print Volume info */
+printf("Name: %s\n", SDL_CDName(0));
+printf("Tracks: %d\n", cdrom->numtracks);
+for(cur_track=0;cur_track < cdrom->numtracks; cur_track++){
+  FRAMES_TO_MSF(cdrom->track[cur_track].length, &min, &sec, &frame);
+  printf("\tTrack %d: Length %d:%d\n", cur_track, min, sec);
+}
+
+SDL_CDClose(cdrom);

PrevHomeNext
SDL_CDNameUpSDL_CDStatus
\ No newline at end of file diff --git a/docs/html/sdlcdpause.html b/docs/html/sdlcdpause.html new file mode 100644 index 0000000..4def8e3 --- /dev/null +++ b/docs/html/sdlcdpause.html @@ -0,0 +1,233 @@ +SDL_CDPause
SDL Library Documentation
PrevNext

SDL_CDPause

Name

SDL_CDPause -- Pauses a CDROM

Synopsis

#include "SDL.h"

int SDL_CDPause(SDL_CD *cdrom);

Description

Pauses play on the given cdrom.

Return Value

Returns 0 on success, or -1 on an error.


PrevHomeNext
SDL_CDPlayTracksUpSDL_CDResume
\ No newline at end of file diff --git a/docs/html/sdlcdplay.html b/docs/html/sdlcdplay.html new file mode 100644 index 0000000..dc6489c --- /dev/null +++ b/docs/html/sdlcdplay.html @@ -0,0 +1,243 @@ +SDL_CDPlay
SDL Library Documentation
PrevNext

SDL_CDPlay

Name

SDL_CDPlay -- Play a CD

Synopsis

#include "SDL.h"

int SDL_CDPlay(SDL_CD *cdrom, int start, int length);

Description

Plays the given cdrom, starting a frame start for length frames.

Return Values

Returns 0 on success, or -1 on an error.


PrevHomeNext
SDL_CDStatusUpSDL_CDPlayTracks
\ No newline at end of file diff --git a/docs/html/sdlcdplaytracks.html b/docs/html/sdlcdplaytracks.html new file mode 100644 index 0000000..7546181 --- /dev/null +++ b/docs/html/sdlcdplaytracks.html @@ -0,0 +1,325 @@ +SDL_CDPlayTracks
SDL Library Documentation
PrevNext

SDL_CDPlayTracks

Name

SDL_CDPlayTracks -- Play the given CD track(s)

Synopsis

#include "SDL.h"

int SDL_CDPlayTracks(SDL_CD *cdrom, int start_track, int start_frame, int ntracks, int nframes));

Description

SDL_CDPlayTracks plays the given CD starting at track +start_track, for ntracks tracks.

start_frame is the frame offset, from the beginning of the start_track, at which to start. nframes is the frame offset, from the beginning of the last track (start_track+ntracks), at which to end playing.

SDL_CDPlayTracks should only be called after calling +SDL_CDStatus +to get track information about the CD.

Note: Data tracks are ignored.

Return Value

Returns 0, or -1 +if there was an error.

Examples

/* assuming cdrom is a previously opened device */
+/* Play the entire CD */
+if(CD_INDRIVE(SDL_CDStatus(cdrom)))
+  SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
+
+/* Play the first track */
+if(CD_INDRIVE(SDL_CDStatus(cdrom)))
+  SDL_CDPlayTracks(cdrom, 0, 0, 1, 0);
+
+/* Play first 15 seconds of the 2nd track */
+if(CD_INDRIVE(SDL_CDStatus(cdrom)))
+  SDL_CDPlayTracks(cdrom, 1, 0, 0, CD_FPS*15);
+


PrevHomeNext
SDL_CDPlayUpSDL_CDPause
\ No newline at end of file diff --git a/docs/html/sdlcdresume.html b/docs/html/sdlcdresume.html new file mode 100644 index 0000000..4a25ab6 --- /dev/null +++ b/docs/html/sdlcdresume.html @@ -0,0 +1,233 @@ +SDL_CDResume
SDL Library Documentation
PrevNext

SDL_CDResume

Name

SDL_CDResume -- Resumes a CDROM

Synopsis

#include "SDL.h"

int SDL_CDResume(SDL_CD *cdrom);

Description

Resumes play on the given cdrom.

Return Value

Returns 0 on success, or -1 on an error.


PrevHomeNext
SDL_CDPauseUpSDL_CDStop
\ No newline at end of file diff --git a/docs/html/sdlcdstatus.html b/docs/html/sdlcdstatus.html new file mode 100644 index 0000000..3ebf965 --- /dev/null +++ b/docs/html/sdlcdstatus.html @@ -0,0 +1,273 @@ +SDL_CDStatus
SDL Library Documentation
PrevNext

SDL_CDStatus

Name

SDL_CDStatus -- Returns the current status of the given drive.

Synopsis

#include "SDL.h"

CDstatus SDL_CDStatus(SDL_CD *cdrom);

/* Given a status, returns true if there's a disk in the drive */
+#define CD_INDRIVE(status)      ((int)status > 0)

Description

This function returns the current status of the given drive. Status is described like so: +

typedef enum {
+  CD_TRAYEMPTY,
+  CD_STOPPED,
+  CD_PLAYING,
+  CD_PAUSED,
+  CD_ERROR = -1
+} CDstatus;

If the drive has a CD in it, the table of contents of the CD and current +play position of the CD will be stored in the SDL_CD structure.

The macro CD_INDRIVE is provided for convenience, +and given a status returns true if there's a disk in the drive.

Note: SDL_CDStatus also updates the SDL_CD structure passed to it.

Example

int playTrack(int track)
+{
+  int playing = 0;
+
+  if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
+  /* clamp to the actual number of tracks on the CD */
+    if (track >= cdrom->numtracks) {
+      track = cdrom->numtracks-1;
+    }
+
+    if ( SDL_CDPlayTracks(cdrom, track, 0, 1, 0) == 0 ) {
+      playing = 1;
+    }
+  }
+  return playing;
+}

See Also

SDL_CD


PrevHomeNext
SDL_CDOpenUpSDL_CDPlay
\ No newline at end of file diff --git a/docs/html/sdlcdstop.html b/docs/html/sdlcdstop.html new file mode 100644 index 0000000..68f8d81 --- /dev/null +++ b/docs/html/sdlcdstop.html @@ -0,0 +1,226 @@ +SDL_CDStop
SDL Library Documentation
PrevNext

SDL_CDStop

Name

SDL_CDStop -- Stops a CDROM

Synopsis

#include "SDL.h"

int SDL_CDStop(SDL_CD *cdrom);

Description

Stops play on the given cdrom.

Return Value

Returns 0 on success, or -1 on an error.

See Also

SDL_CDPlay,


PrevHomeNext
SDL_CDResumeUpSDL_CDEject
\ No newline at end of file diff --git a/docs/html/sdlcdtrack.html b/docs/html/sdlcdtrack.html new file mode 100644 index 0000000..bbb04bb --- /dev/null +++ b/docs/html/sdlcdtrack.html @@ -0,0 +1,313 @@ +SDL_CDtrack
SDL Library Documentation
PrevNext

SDL_CDtrack

Name

SDL_CDtrack -- CD Track Information Structure

Structure Definition

typedef struct{
+  Uint8 id;
+  Uint8 type;
+  Uint32 length;
+  Uint32 offset;
+} SDL_CDtrack;

Structure Data

idTrack number (0-99)
typeSDL_AUDIO_TRACK or SDL_DATA_TRACK
lengthLength, in frames, of this track
offsetFrame offset to the beginning of this track

Description

SDL_CDtrack stores data on each track on a CD, its fields should be pretty self explainatory. It is a member a the SDL_CD structure.

Note: Frames can be converted to standard timings. There are CD_FPS frames per second, so SDL_CDtrack.length/CD_FPS=length_in_seconds.

See Also

SDL_CD


PrevHomeNext
SDL_CDUpMulti-threaded Programming
\ No newline at end of file diff --git a/docs/html/sdlcloseaudio.html b/docs/html/sdlcloseaudio.html new file mode 100644 index 0000000..599f058 --- /dev/null +++ b/docs/html/sdlcloseaudio.html @@ -0,0 +1,205 @@ +SDL_CloseAudio
SDL Library Documentation
PrevNext

SDL_CloseAudio

Name

SDL_CloseAudio -- Shuts down audio processing and closes the audio device.

Synopsis

#include "SDL.h"

void SDL_CloseAudio(void);

Description

This function shuts down audio processing and closes the audio device.

See Also

SDL_OpenAudio


PrevHomeNext
SDL_UnlockAudioUpCD-ROM
\ No newline at end of file diff --git a/docs/html/sdlcolor.html b/docs/html/sdlcolor.html new file mode 100644 index 0000000..c8b7d44 --- /dev/null +++ b/docs/html/sdlcolor.html @@ -0,0 +1,300 @@ +SDL_Color
SDL Library Documentation
PrevNext

SDL_Color

Name

SDL_Color -- Format independent color description

Structure Definition

typedef struct{
+  Uint8 r;
+  Uint8 g;
+  Uint8 b;
+  Uint8 unused;
+} SDL_Color;

Structure Data

rRed intensity
gGreen intensity
bBlue intensity
unusedUnused

Description

SDL_Color describes a color in a format independent way. You can convert a SDL_Color to a pixel value for a certain pixel format using SDL_MapRGB.


PrevHomeNext
SDL_RectUpSDL_Palette
\ No newline at end of file diff --git a/docs/html/sdlcondbroadcast.html b/docs/html/sdlcondbroadcast.html new file mode 100644 index 0000000..9b0fc83 --- /dev/null +++ b/docs/html/sdlcondbroadcast.html @@ -0,0 +1,224 @@ +SDL_CondBroadcast
SDL Library Documentation
PrevNext

SDL_CondBroadcast

Name

SDL_CondBroadcast -- Restart all threads waiting on a condition variable

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

int SDL_CondBroadcast(SDL_cond *cond);

Description

Restarts all threads that are waiting on the condition variable, cond. Returns 0 on success, or -1 on an error.


PrevHomeNext
SDL_CondSignalUpSDL_CondWait
\ No newline at end of file diff --git a/docs/html/sdlcondsignal.html b/docs/html/sdlcondsignal.html new file mode 100644 index 0000000..24e9175 --- /dev/null +++ b/docs/html/sdlcondsignal.html @@ -0,0 +1,224 @@ +SDL_CondSignal
SDL Library Documentation
PrevNext

SDL_CondSignal

Name

SDL_CondSignal -- Restart a thread wait on a condition variable

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

int SDL_CondSignal(SDL_cond *cond);

Description

Restart one of the threads that are waiting on the condition variable, cond. Returns 0 on success of -1 on an error.


PrevHomeNext
SDL_DestroyCondUpSDL_CondBroadcast
\ No newline at end of file diff --git a/docs/html/sdlcondwait.html b/docs/html/sdlcondwait.html new file mode 100644 index 0000000..8f15452 --- /dev/null +++ b/docs/html/sdlcondwait.html @@ -0,0 +1,231 @@ +SDL_CondWait
SDL Library Documentation
PrevNext

SDL_CondWait

Name

SDL_CondWait -- Wait on a condition variable

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

int SDL_CondWait(SDL_cond *cond, SDL_mutex *mut);

Description

Wait on the condition variable cond and unlock the provided mutex. The mutex must the locked before entering this function. Returns 0 when it is signalled, or -1 on an error.


PrevHomeNext
SDL_CondBroadcastUpSDL_CondWaitTimeout
\ No newline at end of file diff --git a/docs/html/sdlcondwaittimeout.html b/docs/html/sdlcondwaittimeout.html new file mode 100644 index 0000000..deed50b --- /dev/null +++ b/docs/html/sdlcondwaittimeout.html @@ -0,0 +1,230 @@ +SDL_CondWaitTimeout
SDL Library Documentation
PrevNext

SDL_CondWaitTimeout

Name

SDL_CondWaitTimeout -- Wait on a condition variable, with timeout

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms);

Description

Wait on the condition variable cond for, at most, ms milliseconds. mut is unlocked so it must be locked when the function is called. Returns SDL_MUTEX_TIMEDOUT if the condition is not signalled in the allotted time, 0 if it was signalled or -1 on an error.

See Also

SDL_CondWait


PrevHomeNext
SDL_CondWaitUpTime
\ No newline at end of file diff --git a/docs/html/sdlconvertaudio.html b/docs/html/sdlconvertaudio.html new file mode 100644 index 0000000..52f1229 --- /dev/null +++ b/docs/html/sdlconvertaudio.html @@ -0,0 +1,407 @@ +SDL_ConvertAudio
SDL Library Documentation
PrevNext

SDL_ConvertAudio

Name

SDL_ConvertAudio -- Convert audio data to a desired audio format.

Synopsis

#include "SDL.h"

int SDL_ConvertAudio(SDL_AudioCVT *cvt);

Description

SDL_ConvertAudio takes one parameter, cvt, which was previously initilized. Initilizing a SDL_AudioCVT is a two step process. First of all, the structure must be passed to SDL_BuildAudioCVT along with source and destination format parameters. Secondly, the cvt->buf and cvt->len fields must be setup. cvt->buf should point to the audio data and cvt->len should be set to the length of the audio data in bytes. Remember, the length of the buffer pointed to by buf show be len*len_mult bytes in length.

Once the SDL_AudioCVTstructure is initilized then we can pass it to SDL_ConvertAudio, which will convert the audio data pointer to by cvt->buf. If SDL_ConvertAudio returned 0 then the conversion was completed successfully, otherwise -1 is returned.

If the conversion completed successfully then the converted audio data can be read from cvt->buf. The amount of valid, converted, audio data in the buffer is equal to cvt->len*cvt->len_ratio.

Examples

/* Converting some WAV data to hardware format */
+void my_audio_callback(void *userdata, Uint8 *stream, int len);
+
+SDL_AudioSpec *desired, *obtained;
+SDL_AudioSpec wav_spec;
+SDL_AudioCVT  wav_cvt;
+Uint32 wav_len;
+Uint8 *wav_buf;
+int ret;
+
+/* Allocated audio specs */
+desired = malloc(sizeof(SDL_AudioSpec));
+obtained = malloc(sizeof(SDL_AudioSpec));
+
+/* Set desired format */
+desired->freq=22050;
+desired->format=AUDIO_S16LSB;
+desired->samples=8192;
+desired->callback=my_audio_callback;
+desired->userdata=NULL;
+
+/* Open the audio device */
+if ( SDL_OpenAudio(desired, obtained) < 0 ){
+  fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
+  exit(-1);
+}
+        
+free(desired);
+
+/* Load the test.wav */
+if( SDL_LoadWAV("test.wav", &wav_spec, &wav_buf, &wav_len) == NULL ){
+  fprintf(stderr, "Could not open test.wav: %s\n", SDL_GetError());
+  SDL_CloseAudio();
+  free(obtained);
+  exit(-1);
+}
+                                            
+/* Build AudioCVT */
+ret = SDL_BuildAudioCVT(&wav_cvt,
+                        wav_spec.format, wav_spec.channels, wav_spec.freq,
+                        obtained->format, obtained->channels, obtained->freq);
+
+/* Check that the convert was built */
+if(ret==-1){
+  fprintf(stderr, "Couldn't build converter!\n");
+  SDL_CloseAudio();
+  free(obtained);
+  SDL_FreeWAV(wav_buf);
+}
+
+/* Setup for conversion */
+wav_cvt.buf = malloc(wav_len * wav_cvt.len_mult);
+wav_cvt.len = wav_len;
+memcpy(wav_cvt.buf, wav_buf, wav_len);
+
+/* We can delete to original WAV data now */
+SDL_FreeWAV(wav_buf);
+
+/* And now we're ready to convert */
+SDL_ConvertAudio(&wav_cvt);
+
+/* do whatever */
+.
+.
+.
+.
+

PrevHomeNext
SDL_BuildAudioCVTUpSDL_MixAudio
\ No newline at end of file diff --git a/docs/html/sdlconvertsurface.html b/docs/html/sdlconvertsurface.html new file mode 100644 index 0000000..cc21f78 --- /dev/null +++ b/docs/html/sdlconvertsurface.html @@ -0,0 +1,271 @@ +SDL_ConvertSurface
SDL Library Documentation
PrevNext

SDL_ConvertSurface

Name

SDL_ConvertSurface -- Converts a surface to the same format as another surface.

Synopsis

#include "SDL/SDL.h"

SDL_Surface *SDL_ConvertSurface(SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags);

Description

Creates a new surface of the specified format, and then copies and maps +the given surface to it. If this function fails, it returns +NULL.

The flags parameter is passed to +SDL_CreateRGBSurface +and has those semantics.

This function is used internally by +SDL_DisplayFormat.

This function can only be called after SDL_Init.

Return Value

Returns either a pointer to the new surface, or +NULL on error.


PrevHomeNext
SDL_GetClipRectUpSDL_BlitSurface
\ No newline at end of file diff --git a/docs/html/sdlcreatecond.html b/docs/html/sdlcreatecond.html new file mode 100644 index 0000000..02fcdb2 --- /dev/null +++ b/docs/html/sdlcreatecond.html @@ -0,0 +1,240 @@ +SDL_CreateCond
SDL Library Documentation
PrevNext

SDL_CreateCond

Name

SDL_CreateCond -- Create a condition variable

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

SDL_cond *SDL_CreateCond(void);

Description

Creates a condition variable.

Examples

SDL_cond *cond;
+
+cond=SDL_CreateCond();
+.
+.
+/* Do stuff */
+
+.
+.
+SDL_DestroyCond(cond);

PrevHomeNext
SDL_SemValueUpSDL_DestroyCond
\ No newline at end of file diff --git a/docs/html/sdlcreatecursor.html b/docs/html/sdlcreatecursor.html new file mode 100644 index 0000000..a444165 --- /dev/null +++ b/docs/html/sdlcreatecursor.html @@ -0,0 +1,398 @@ +SDL_CreateCursor
SDL Library Documentation
PrevNext

SDL_CreateCursor

Name

SDL_CreateCursor -- Creates a new mouse cursor.

Synopsis

#include "SDL.h"

SDL_Cursor *SDL_CreateCursor(Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);

Description

Create a cursor using the specified data and mask (in MSB format). +The cursor width must be a multiple of 8 bits.

The cursor is created in black and white according to the following: +

Data / MaskResulting pixel on screen
0 / 1White
1 / 1Black
0 / 0Transparent
1 / 0Inverted color if possible, black if not.

Cursors created with this function must be freed with +SDL_FreeCursor.

Example

/* Stolen from the mailing list */
+/* Creates a new mouse cursor from an XPM */
+
+
+/* XPM */
+static const char *arrow[] = {
+  /* width height num_colors chars_per_pixel */
+  "    32    32        3            1",
+  /* colors */
+  "X c #000000",
+  ". c #ffffff",
+  "  c None",
+  /* pixels */
+  "X                               ",
+  "XX                              ",
+  "X.X                             ",
+  "X..X                            ",
+  "X...X                           ",
+  "X....X                          ",
+  "X.....X                         ",
+  "X......X                        ",
+  "X.......X                       ",
+  "X........X                      ",
+  "X.....XXXXX                     ",
+  "X..X..X                         ",
+  "X.X X..X                        ",
+  "XX  X..X                        ",
+  "X    X..X                       ",
+  "     X..X                       ",
+  "      X..X                      ",
+  "      X..X                      ",
+  "       XX                       ",
+  "                                ",
+  "                                ",
+  "                                ",
+  "                                ",
+  "                                ",
+  "                                ",
+  "                                ",
+  "                                ",
+  "                                ",
+  "                                ",
+  "                                ",
+  "                                ",
+  "                                ",
+  "0,0"
+};
+
+static SDL_Cursor *init_system_cursor(const char *image[])
+{
+  int i, row, col;
+  Uint8 data[4*32];
+  Uint8 mask[4*32];
+  int hot_x, hot_y;
+
+  i = -1;
+  for ( row=0; row<32; ++row ) {
+    for ( col=0; col<32; ++col ) {
+      if ( col % 8 ) {
+        data[i] <<= 1;
+        mask[i] <<= 1;
+      } else {
+        ++i;
+        data[i] = mask[i] = 0;
+      }
+      switch (image[4+row][col]) {
+        case 'X':
+          data[i] |= 0x01;
+          mask[i] |= 0x01;
+          break;
+        case '.':
+          mask[i] |= 0x01;
+          break;
+        case ' ':
+          break;
+      }
+    }
+  }
+  sscanf(image[4+row], "%d,%d", &hot_x, &hot_y);
+  return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y);
+}

PrevHomeNext
SDL_WarpMouseUpSDL_FreeCursor
\ No newline at end of file diff --git a/docs/html/sdlcreatemutex.html b/docs/html/sdlcreatemutex.html new file mode 100644 index 0000000..53ed48b --- /dev/null +++ b/docs/html/sdlcreatemutex.html @@ -0,0 +1,249 @@ +SDL_CreateMutex
SDL Library Documentation
PrevNext

SDL_CreateMutex

Name

SDL_CreateMutex -- Create a mutex

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

SDL_mutex *SDL_CreateMutex(void);

Description

Create a new, unlocked mutex.

Examples

SDL_mutex *mut;
+
+mut=SDL_CreateMutex();
+.
+.
+if(SDL_mutexP(mut)==-1){
+  fprintf(stderr, "Couldn't lock mutex\n");
+  exit(-1);
+}
+.
+/* Do stuff while mutex is locked */
+.
+.
+if(SDL_mutexV(mut)==-1){
+  fprintf(stderr, "Couldn't unlock mutex\n");
+  exit(-1);
+}
+
+SDL_DestroyMutex(mut);

PrevHomeNext
SDL_KillThreadUpSDL_DestroyMutex
\ No newline at end of file diff --git a/docs/html/sdlcreatergbsurface.html b/docs/html/sdlcreatergbsurface.html new file mode 100644 index 0000000..736ec8f --- /dev/null +++ b/docs/html/sdlcreatergbsurface.html @@ -0,0 +1,458 @@ +SDL_CreateRGBSurface
SDL Library Documentation
PrevNext

SDL_CreateRGBSurface

Name

SDL_CreateRGBSurface -- Create an empty SDL_Surface

Synopsis

#include "SDL.h"

SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);

Description

Allocate an empty surface (must be called after SDL_SetVideoMode)

If depth is 8 bits an empty palette is allocated for the surface, otherwise a 'packed-pixel' SDL_PixelFormat is created using the [RGBA]mask's provided (see SDL_PixelFormat). The flags specifies the type of surface that should be created, it is an OR'd combination of the following possible values.

SDL_SWSURFACESDL will create the surface in system memory. This improves the performance of pixel level access, however you may not be able to take advantage of some types of hardware blitting.
SDL_HWSURFACESDL will attempt to create the surface in video memory. This will allow SDL to take advantage of Video->Video blits (which are often accelerated).
SDL_SRCCOLORKEYThis flag turns on colourkeying for blits from this surface. If +SDL_HWSURFACE is also specified and colourkeyed blits +are hardware-accelerated, then SDL will attempt to place the surface in +video memory. +Use SDL_SetColorKey +to set or clear this flag after surface creation.
SDL_SRCALPHAThis flag turns on alpha-blending for blits from this surface. If +SDL_HWSURFACE is also specified and alpha-blending blits +are hardware-accelerated, then the surface will be placed in video memory if +possible. +Use SDL_SetAlpha to +set or clear this flag after surface creation.

Note: If an alpha-channel is specified (that is, if Amask is +nonzero), then the SDL_SRCALPHA flag is automatically +set. You may remove this flag by calling +SDL_SetAlpha +after surface creation.

Return Value

Returns the created surface, or NULL upon error.

Example

    /* Create a 32-bit surface with the bytes of each pixel in R,G,B,A order,
+       as expected by OpenGL for textures */
+    SDL_Surface *surface;
+    Uint32 rmask, gmask, bmask, amask;
+
+    /* SDL interprets each pixel as a 32-bit number, so our masks must depend
+       on the endianness (byte order) of the machine */
+#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+    rmask = 0xff000000;
+    gmask = 0x00ff0000;
+    bmask = 0x0000ff00;
+    amask = 0x000000ff;
+#else
+    rmask = 0x000000ff;
+    gmask = 0x0000ff00;
+    bmask = 0x00ff0000;
+    amask = 0xff000000;
+#endif
+
+    surface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32,
+                                   rmask, gmask, bmask, amask);
+    if(surface == NULL) {
+        fprintf(stderr, "CreateRGBSurface failed: %s\n", SDL_GetError());
+        exit(1);
+    }

PrevHomeNext
SDL_GetRGBAUpSDL_CreateRGBSurfaceFrom
\ No newline at end of file diff --git a/docs/html/sdlcreatergbsurfacefrom.html b/docs/html/sdlcreatergbsurfacefrom.html new file mode 100644 index 0000000..6acfdcc --- /dev/null +++ b/docs/html/sdlcreatergbsurfacefrom.html @@ -0,0 +1,256 @@ +SDL_CreateRGBSurfaceFrom
SDL Library Documentation
PrevNext

SDL_CreateRGBSurfaceFrom

Name

SDL_CreateRGBSurfaceFrom -- Create an SDL_Surface from pixel data

Synopsis

#include "SDL.h"

SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);

Description

Creates an SDL_Surface from the provided pixel data.

The data stored in pixels is assumed to be of the depth specified in the parameter list. The pixel data is not copied into the SDL_Surface structure so it should not be freed until the surface has been freed with a called to SDL_FreeSurface. pitch is the length of each scanline in bytes.

See SDL_CreateRGBSurface for a more detailed description of the other parameters.

Return Value

Returns the created surface, or NULL upon error.


PrevHomeNext
SDL_CreateRGBSurfaceUpSDL_FreeSurface
\ No newline at end of file diff --git a/docs/html/sdlcreatesemaphore.html b/docs/html/sdlcreatesemaphore.html new file mode 100644 index 0000000..43dcbf5 --- /dev/null +++ b/docs/html/sdlcreatesemaphore.html @@ -0,0 +1,303 @@ +SDL_CreateSemaphore
SDL Library Documentation
PrevNext

SDL_CreateSemaphore

Name

SDL_CreateSemaphore -- Creates a new semaphore and assigns an initial value to it.

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

SDL_sem *SDL_CreateSemaphore(Uint32 initial_value);

Description

SDL_CreateSemaphore() creates a new semaphore and +initializes it with the value initial_value. +Each locking operation on the semaphore by +SDL_SemWait, +SDL_SemTryWait or +SDL_SemWaitTimeout +will atomically decrement the semaphore value. The locking operation will be blocked +if the semaphore value is not positive (greater than zero). Each unlock operation by +SDL_SemPost +will atomically increment the semaphore value.

Return Value

Returns a pointer to an initialized semaphore or +NULL if there was an error.

Examples

SDL_sem *my_sem;
+
+my_sem = SDL_CreateSemaphore(INITIAL_SEM_VALUE);
+
+if (my_sem == NULL) {
+        return CREATE_SEM_FAILED;
+}


PrevHomeNext
SDL_mutexVUpSDL_DestroySemaphore
\ No newline at end of file diff --git a/docs/html/sdlcreatethread.html b/docs/html/sdlcreatethread.html new file mode 100644 index 0000000..ca3c2d9 --- /dev/null +++ b/docs/html/sdlcreatethread.html @@ -0,0 +1,223 @@ +SDL_CreateThread
SDL Library Documentation
PrevNext

SDL_CreateThread

Name

SDL_CreateThread -- Creates a new thread of execution that shares its parent's properties.

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

SDL_Thread *SDL_CreateThread(int (*fn)(void *), void *data);

Description

SDL_CreateThread creates a new thread of execution +that shares all of its parent's global memory, signal handlers, +file descriptors, etc, and runs the function fn +passed the void pointer data +The thread quits when this function returns.


PrevHomeNext
Multi-threaded ProgrammingUpSDL_ThreadID
\ No newline at end of file diff --git a/docs/html/sdlcreateyuvoverlay.html b/docs/html/sdlcreateyuvoverlay.html new file mode 100644 index 0000000..c24ef6e --- /dev/null +++ b/docs/html/sdlcreateyuvoverlay.html @@ -0,0 +1,256 @@ +SDL_CreateYUVOverlay
SDL Library Documentation
PrevNext

SDL_CreateYUVOverlay

Name

SDL_CreateYUVOverlay -- Create a YUV video overlay

Synopsis

#include "SDL.h"

SDL_Overlay *SDL_CreateYUVOverlay(int width, int height, Uint32 format, SDL_Surface *display);

Description

SDL_CreateYUVOverlay creates a YUV overlay of the specified width, height and format (see SDL_Overlay for a list of available formats), for the provided display. A SDL_Overlay structure is returned.

The term 'overlay' is a misnomer since, unless the overlay is created in hardware, the contents for the display surface underneath the area where the overlay is shown will be overwritten when the overlay is displayed.


PrevHomeNext
SDL_GL_SwapBuffersUpSDL_LockYUVOverlay
\ No newline at end of file diff --git a/docs/html/sdldelay.html b/docs/html/sdldelay.html new file mode 100644 index 0000000..a5417fa --- /dev/null +++ b/docs/html/sdldelay.html @@ -0,0 +1,231 @@ +SDL_Delay
SDL Library Documentation
PrevNext

SDL_Delay

Name

SDL_Delay -- Wait a specified number of milliseconds before returning.

Synopsis

#include "SDL.h"

void SDL_Delay(Uint32 ms);

Description

Wait a specified number of milliseconds before returning. SDL_Delay will wait at least the specified time, but possible longer due to OS scheduling.

Note: Count on a delay granularity of at least 10 ms. +Some platforms have shorter clock ticks but this is the most common.

See Also

SDL_AddTimer


PrevHomeNext
SDL_GetTicksUpSDL_AddTimer
\ No newline at end of file diff --git a/docs/html/sdldestroycond.html b/docs/html/sdldestroycond.html new file mode 100644 index 0000000..ac08042 --- /dev/null +++ b/docs/html/sdldestroycond.html @@ -0,0 +1,206 @@ +SDL_DestroyCond
SDL Library Documentation
PrevNext

SDL_DestroyCond

Name

SDL_DestroyCond -- Destroy a condition variable

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

void SDL_DestroyCond(SDL_cond *cond);

Description

Destroys a condition variable.


PrevHomeNext
SDL_CreateCondUpSDL_CondSignal
\ No newline at end of file diff --git a/docs/html/sdldestroymutex.html b/docs/html/sdldestroymutex.html new file mode 100644 index 0000000..949bfc5 --- /dev/null +++ b/docs/html/sdldestroymutex.html @@ -0,0 +1,209 @@ +SDL_DestroyMutex
SDL Library Documentation
PrevNext

SDL_DestroyMutex

Name

SDL_DestroyMutex -- Destroy a mutex

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

void SDL_DestroyMutex(SDL_mutex *mutex);

Description

Destroy a previously created mutex.


PrevHomeNext
SDL_CreateMutexUpSDL_mutexP
\ No newline at end of file diff --git a/docs/html/sdldestroysemaphore.html b/docs/html/sdldestroysemaphore.html new file mode 100644 index 0000000..d32bdfa --- /dev/null +++ b/docs/html/sdldestroysemaphore.html @@ -0,0 +1,278 @@ +SDL_DestroySemaphore
SDL Library Documentation
PrevNext

SDL_DestroySemaphore

Name

SDL_DestroySemaphore -- Destroys a semaphore that was created by SDL_CreateSemaphore.

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

void SDL_DestroySemaphore(SDL_sem *sem);

Description

SDL_DestroySemaphore destroys the semaphore pointed to +by sem that was created by +SDL_CreateSemaphore. +It is not safe to destroy a semaphore if there are threads currently blocked +waiting on it.

Examples

if (my_sem != NULL) {
+        SDL_DestroySemaphore(my_sem);
+        my_sem = NULL;
+}


PrevHomeNext
SDL_CreateSemaphoreUpSDL_SemWait
\ No newline at end of file diff --git a/docs/html/sdldisplayformat.html b/docs/html/sdldisplayformat.html new file mode 100644 index 0000000..c91adfe --- /dev/null +++ b/docs/html/sdldisplayformat.html @@ -0,0 +1,262 @@ +SDL_DisplayFormat
SDL Library Documentation
PrevNext

SDL_DisplayFormat

Name

SDL_DisplayFormat -- Convert a surface to the display format

Synopsis

#include "SDL.h"

SDL_Surface *SDL_DisplayFormat(SDL_Surface *surface);

Description

This function takes a surface and copies it to a new surface of the +pixel format and colors of the video framebuffer, suitable for fast +blitting onto the display surface. It calls +SDL_ConvertSurface

If you want to take advantage of hardware colorkey or alpha blit +acceleration, you should set the colorkey and alpha value before +calling this function.

If you want an alpha channel, see SDL_DisplayFormatAlpha.

Return Value

If the conversion fails or runs out of memory, it returns +NULL


PrevHomeNext
SDL_FillRectUpSDL_DisplayFormatAlpha
\ No newline at end of file diff --git a/docs/html/sdldisplayformatalpha.html b/docs/html/sdldisplayformatalpha.html new file mode 100644 index 0000000..6e88604 --- /dev/null +++ b/docs/html/sdldisplayformatalpha.html @@ -0,0 +1,250 @@ +SDL_DisplayFormatAlpha
SDL Library Documentation
PrevNext

SDL_DisplayFormatAlpha

Name

SDL_DisplayFormatAlpha -- Convert a surface to the display format

Synopsis

#include "SDL.h"

SDL_Surface *SDL_DisplayFormatAlpha(SDL_Surface *surface);

Description

This function takes a surface and copies it to a new surface of the +pixel format and colors of the video framebuffer plus an alpha channel, +suitable for fast blitting onto the display surface. It calls +SDL_ConvertSurface

If you want to take advantage of hardware colorkey or alpha blit +acceleration, you should set the colorkey and alpha value before +calling this function.

This function can be used to convert a colourkey to an alpha channel, +if the SDL_SRCCOLORKEY flag is set on the surface. +The generated surface will then be transparent (alpha=0) where the +pixels match the colourkey, and opaque (alpha=255) elsewhere.

Return Value

If the conversion fails or runs out of memory, it returns +NULL


PrevHomeNext
SDL_DisplayFormatUpSDL_WarpMouse
\ No newline at end of file diff --git a/docs/html/sdldisplayyuvoverlay.html b/docs/html/sdldisplayyuvoverlay.html new file mode 100644 index 0000000..456c998 --- /dev/null +++ b/docs/html/sdldisplayyuvoverlay.html @@ -0,0 +1,246 @@ +SDL_DisplayYUVOverlay
SDL Library Documentation
PrevNext

SDL_DisplayYUVOverlay

Name

SDL_DisplayYUVOverlay -- Blit the overlay to the display

Synopsis

#include "SDL.h"

int SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect);

Description

Blit the overlay to the surface specified when it was created. The SDL_Rect structure, dstrect, specifies the position and size of the destination. If the dstrect is a larger or smaller than the overlay then the overlay will be scaled, this is optimized for 2x scaling.

Return Values

Returns 0 on success


PrevHomeNext
SDL_UnlockYUVOverlayUpSDL_FreeYUVOverlay
\ No newline at end of file diff --git a/docs/html/sdlenablekeyrepeat.html b/docs/html/sdlenablekeyrepeat.html new file mode 100644 index 0000000..878feb1 --- /dev/null +++ b/docs/html/sdlenablekeyrepeat.html @@ -0,0 +1,238 @@ +SDL_EnableKeyRepeat
SDL Library Documentation
PrevNext

SDL_EnableKeyRepeat

Name

SDL_EnableKeyRepeat -- Set keyboard repeat rate.

Synopsis

#include "SDL.h"

int SDL_EnableKeyRepeat(int delay, int interval);

Description

Enables or disables the keyboard repeat rate. delay specifies how long the key must be pressed before it begins repeating, it then repeats at the speed specified by interval. Both delay and interval are expressed in milliseconds.

Setting delay to 0 disables key repeating completely. Good default values are SDL_DEFAULT_REPEAT_DELAY and SDL_DEFAULT_REPEAT_INTERVAL.

Return Value

Returns 0 on success and -1 on failure.


PrevHomeNext
SDL_EnableUNICODEUpSDL_GetMouseState
\ No newline at end of file diff --git a/docs/html/sdlenableunicode.html b/docs/html/sdlenableunicode.html new file mode 100644 index 0000000..855debb --- /dev/null +++ b/docs/html/sdlenableunicode.html @@ -0,0 +1,252 @@ +SDL_EnableUNICODE
SDL Library Documentation
PrevNext

SDL_EnableUNICODE

Name

SDL_EnableUNICODE -- Enable UNICODE translation

Synopsis

#include "SDL.h"

int SDL_EnableUNICODE(int enable);

Description

Enables/Disables Unicode keyboard translation.

To obtain the character codes corresponding to received keyboard events, +Unicode translation must first be turned on using this function. The +translation incurs a slight overhead for each keyboard event and is therefore +disabled by default. For each subsequently received key down event, the +unicode member of the +SDL_keysym structure +will then contain the corresponding character code, or zero for keysyms that do +not correspond to any character code.

A value of 1 for enable enables Unicode translation; +0 disables it, and -1 leaves it unchanged (useful for querying the current +translation mode).

Note that only key press events will be translated, not release events.

Return Value

Returns the previous translation mode (0 or 1).

See Also

SDL_keysym


PrevHomeNext
SDL_GetKeyNameUpSDL_EnableKeyRepeat
\ No newline at end of file diff --git a/docs/html/sdlenvvars.html b/docs/html/sdlenvvars.html new file mode 100644 index 0000000..8999ed1 --- /dev/null +++ b/docs/html/sdlenvvars.html @@ -0,0 +1,1227 @@ +SDL_envvars
SDL Library Documentation
PrevNext

SDL_envvars

Name

SDL_envvars -- SDL environment variables

Description

Not a function, set using setenv()

Several environment variables are available to modify the +behaviour of SDL. Using these variables isn't recommened and the names +and presence of these variables aren't guaranteed from one release to +the next. However, they can be very useful for debugging +purposes.

Video

SDL_FBACCEL

If set to 0, disable hardware acceleration in the linux fbcon driver.

SDL_FBDEV

Frame buffer device to use in the linux fbcon driver, instead of /dev/fb0

SDL_FULLSCREEN_UPDATE

In the ps2gs driver, sets the SDL_ASYNCBLIT flag on the +display surface.

SDL_VIDEODRIVER

Selectes the video driver for SDL to use. Possible values, in the +order they are tried if this variable is not set:

x11

dga

(the XFree86 DGA2)

nanox

(Linux)

fbcon

(Linux)

directfb

(Linux)

ps2gs

(Playstation 2)

ggi

vgl

(BSD)

svgalib

(Linux)

aalib

directx

(Win32)

windib

(Win32)

bwindow

(BeOS)

toolbox

(MacOS Classic)

DSp

(MacOS Classic)

Quartz

(Mac OS X)

CGX

(Amiga)

photon

(QNX)

dummy

SDL_VIDEO_CENTERED

If set, tries to center the SDL window when running in X11 windowed +mode, or using the CyberGrafix driver.

SDL_VIDEO_GL_DRIVER

The openGL driver (shared library) to use for X11. Default is libGL.so.1

SDL_VIDEO_X11_DGAMOUSE

With XFree86, enables use of DGA mouse if set.

SDL_VIDEO_X11_MOUSEACCEL

For X11, sets the mouse acceleration. The value should be a string +on the form:

"n/d/t"

where n and d are the +acceleration numerator/denumerators (so mouse movement is accelerated by +n/d), and +t is the threshold above which acceleration applies +(counted as number of pixels the mouse moves at once).

SDL_VIDEO_X11_NODIRECTCOLOR

If set, don't attempt to use DirectColor visuals even if they are +present. (SDL will use them otherwise for gamma correction). +This is needed with older X servers when using the XVideo extension.

SDL_VIDEO_X11_VISUALID

ID of an X11 visual to use, overriding SDL's default visual selection +algorithm. It can be in decimal or in hex (prefixed by 0x).

SDL_VIDEO_YUV_DIRECT

If set, display YUV overlay directly on the video surface if possible, +instead of on the surface passed to +SDL_CreateYUVOverlay.

SDL_VIDEO_YUV_HWACCEL

If not set or set to a nonzero value, SDL will attempt to use +hardware YUV acceleration for video playback.

SDL_WINDOWID

For X11 or Win32, contains the ID number of the window to be used by +SDL instead of creating its own window. Either in decimal or +in hex (prefixed by 0x).

Events/Input

SDL_MOUSE_RELATIVE

If set to 0, do not use mouse relative mode in X11. The default is +to use it if the mouse is hidden and input is grabbed.

SDL_MOUSEDEV

The mouse device to use for the linux fbcon driver. If not set, +SDL first tries to use GPM in repeater mode, then various other +devices (/dev/pcaux, /dev/adbmouse, /dev/mouse etc).

SDL_MOUSEDEV_IMPS2

If set, SDL will not try to auto-detect the IMPS/2 protocol of +a PS/2 mouse but use it right away. For the fbcon and ps2gs drivers.

SDL_MOUSEDRV

For the linux fbcon driver: if set to ELO, use the ELO touchscreen +controller as a pointer device

SDL_NO_RAWKBD

For the libvga driver: If set, do not attempt to put the keyboard in raw mode.

SDL_NOMOUSE

If set, the linux fbcon driver will not use a mouse at all.

SDL_NO_LOCK_KEYS

Disable CAPS-LOCK and NUM-LOCK suppression of down+up key events, +suitable for games where the player needs these keys to do more than just toggle. +A value of 1 will effect both CAPS-LOCK and NUM-LOCK. +A value of 2 will effect only CAPS-LOCK. +A value of 3 will effect only NUM-LOCK. +All other values have no effect. +

Audio

AUDIODEV

The audio device to use, if SDL_PATH_DSP isn't set.

SDL_AUDIODRIVER

Selects the audio driver for SDL to use. Possible values, in the +order they are tried if this variable is not set:

openbsd

(OpenBSD)

dsp

(OSS /dev/dsp: Linux, Solaris, BSD etc)

alsa

(Linux)

pulse

(PulseAudio daemon)

audio

(Unix style /dev/audio: SunOS, Solaris etc)

AL

(Irix)

artsc

(ARTS audio daemon)

esd

(esound audio daemon)

nas

(NAS audio daemon)

dma

(OSS /dev/dsp, using DMA)

dsound

(Win32 DirectX)

waveout

(Win32 WaveOut)

baudio

(BeOS)

sndmgr

(MacOS SoundManager)

paud

(AIX)

AHI

(Amiga)

disk

(all; output to file)

SDL_DISKAUDIOFILE

The name of the output file for the "disk" audio driver. If not +set, the name sdlaudio.raw is used.

SDL_DISKAUDIODELAY

For the "disk" audio driver, how long to wait (in ms) before writing +a full sound buffer. The default is 150 ms.

SDL_DSP_NOSELECT

For some audio drivers (alsa, paud, dma and dsp), don't use select() +but a timed method instead. May cure some audio problems, or cause +others.

SDL_PATH_DSP

The audio device to use. If not set, SDL tries AUDIODEV and then +a platform-dependent default value (/dev/audio on Solaris, +/dev/dsp on Linux etc).

CD-ROM

SDL_CDROM

A colon-separated list of CD-ROM devices to use, in addition to +the standard devices (typically /dev/cdrom, platform-dependent).

Debugging

SDL_DEBUG

If set, causes every call to SDL_SetError (that +is, every time SDL signals an error) to also print an error message on +stderr.

Joystick

SDL_JOYSTICK_DEVICE

Joystick device to use in the linux joystick driver, in addition +to the usual: /dev/js*, /dev/input/event*, /dev/input/js*

SDL_LINUX_JOYSTICK

Special joystick configuration string for linux. The format is

"name numaxes numhats numballs"

where name is the name string of the joystick +(possibly in single quotes), and the rest are the number of axes, hats +and balls respectively.


PrevHomeNext
SDL_GetErrorUpVideo
diff --git a/docs/html/sdlevent.html b/docs/html/sdlevent.html new file mode 100644 index 0000000..dfd21b7 --- /dev/null +++ b/docs/html/sdlevent.html @@ -0,0 +1,994 @@ +SDL_Event
SDL Library Documentation
PrevNext

SDL_Event

Name

SDL_Event -- General event structure

Structure Definition

typedef union{
+  Uint8 type;
+  SDL_ActiveEvent active;
+  SDL_KeyboardEvent key;
+  SDL_MouseMotionEvent motion;
+  SDL_MouseButtonEvent button;
+  SDL_JoyAxisEvent jaxis;
+  SDL_JoyBallEvent jball;
+  SDL_JoyHatEvent jhat;
+  SDL_JoyButtonEvent jbutton;
+  SDL_ResizeEvent resize;
+  SDL_ExposeEvent expose;
+  SDL_QuitEvent quit;
+  SDL_UserEvent user;
+  SDL_SysWMEvent syswm;
+} SDL_Event;

Description

The SDL_Event union is the core to all event handling is SDL, its probably the most important structure after SDL_Surface. SDL_Event is a union of all event structures used in SDL, using it is a simple matter of knowing which union member relates to which event type.

Event typeEvent Structure
SDL_ACTIVEEVENTSDL_ActiveEvent
SDL_KEYDOWN/UPSDL_KeyboardEvent
SDL_MOUSEMOTIONSDL_MouseMotionEvent
SDL_MOUSEBUTTONDOWN/UPSDL_MouseButtonEvent
SDL_JOYAXISMOTIONSDL_JoyAxisEvent
SDL_JOYBALLMOTIONSDL_JoyBallEvent
SDL_JOYHATMOTIONSDL_JoyHatEvent
SDL_JOYBUTTONDOWN/UPSDL_JoyButtonEvent
SDL_QUITSDL_QuitEvent
SDL_SYSWMEVENTSDL_SysWMEvent
SDL_VIDEORESIZESDL_ResizeEvent
SDL_VIDEOEXPOSESDL_ExposeEvent
SDL_USEREVENTSDL_UserEvent

Use

The SDL_Event structure has two uses

  • Reading events on the event queue

  • Placing events on the event queue

Reading events from the event queue is done with either SDL_PollEvent or SDL_PeepEvents. We'll use SDL_PollEvent and step through an example.

First off, we create an empty SDL_Event structure. +

SDL_Event test_event;
+SDL_PollEvent removes the next event from the event queue, if there are no events on the queue it returns 0 otherwise it returns 1. We use a while loop to process each event in turn. +
while(SDL_PollEvent(&test_event)) {
+The SDL_PollEvent function take a pointer to an SDL_Event structure that is to be filled with event information. We know that if SDL_PollEvent removes an event from the queue then the event information will be placed in our test_event structure, but we also know that the type of event will be placed in the type member of test_event. So to handle each event type seperately we use a switch statement. +
  switch(test_event.type) {
+We need to know what kind of events we're looking for and the event type's of those events. So lets assume we want to detect where the user is moving the mouse pointer within our application. We look through our event types and notice that SDL_MOUSEMOTION is, more than likely, the event we're looking for. A little more research tells use that SDL_MOUSEMOTION events are handled within the SDL_MouseMotionEvent structure which is the motion member of SDL_Event. We can check for the SDL_MOUSEMOTION event type within our switch statement like so: +
    case SDL_MOUSEMOTION:
+All we need do now is read the information out of the motion member of test_event. +
      printf("We got a motion event.\n");
+      printf("Current mouse position is: (%d, %d)\n", test_event.motion.x, test_event.motion.y);
+      break;
+    default:
+      printf("Unhandled Event!\n");
+      break;
+  }
+}
+printf("Event queue empty.\n");

It is also possible to push events onto the event queue and so use it as a two-way communication path. Both SDL_PushEvent and SDL_PeepEvents allow you to place events onto the event queue. This is usually used to place a SDL_USEREVENT on the event queue, however you could use it to post fake input events if you wished. Creating your own events is a simple matter of choosing the event type you want, setting the type member and filling the appropriate member structure with information. +

SDL_Event user_event;
+
+user_event.type=SDL_USEREVENT;
+user_event.user.code=2;
+user_event.user.data1=NULL;
+user_event.user.data2=NULL;
+SDL_PushEvent(&user_event);


PrevHomeNext
SDL Event Structures.UpSDL_ActiveEvent
diff --git a/docs/html/sdleventstate.html b/docs/html/sdleventstate.html new file mode 100644 index 0000000..b9a2448 --- /dev/null +++ b/docs/html/sdleventstate.html @@ -0,0 +1,276 @@ +SDL_EventState
SDL Library Documentation
PrevNext

SDL_EventState

Name

SDL_EventState -- This function allows you to set the state of processing certain events.

Synopsis

#include "SDL.h"

Uint8 SDL_EventState(Uint8 type, int state);

Description

This function allows you to set the state of processing certain event type's.

If state is set to SDL_IGNORE, +that event type will be automatically dropped from the event queue and will +not be filtered.

If state is set to SDL_ENABLE, +that event type will be processed normally.

If state is set to SDL_QUERY, +SDL_EventState will return the current processing +state of the specified event type.

A list of event type's can be found in the SDL_Event section.

See Also

SDL_Event


PrevHomeNext
SDL_GetEventFilterUpSDL_GetKeyState
\ No newline at end of file diff --git a/docs/html/sdlexposeevent.html b/docs/html/sdlexposeevent.html new file mode 100644 index 0000000..82c2a3e --- /dev/null +++ b/docs/html/sdlexposeevent.html @@ -0,0 +1,252 @@ +SDL_ExposeEvent
SDL Library Documentation
PrevNext

SDL_ExposeEvent

Name

SDL_ExposeEvent -- Quit requested event

Structure Definition

typedef struct{
+  Uint8 type
+} SDL_ExposeEvent;

Structure Data

typeSDL_VIDEOEXPOSE

Description

SDL_ExposeEvent is a member of the SDL_Event union and is used whan an event of type SDL_VIDEOEXPOSE is reported.

A VIDEOEXPOSE event is triggered when the screen has been modified +outside of the application, usually by the window manager and needs to +be redrawn.


PrevHomeNext
SDL_ResizeEventUpSDL_SysWMEvent
diff --git a/docs/html/sdlfillrect.html b/docs/html/sdlfillrect.html new file mode 100644 index 0000000..4ace062 --- /dev/null +++ b/docs/html/sdlfillrect.html @@ -0,0 +1,291 @@ +SDL_FillRect
SDL Library Documentation
PrevNext

SDL_FillRect

Name

SDL_FillRect -- This function performs a fast fill of the given rectangle with some color

Synopsis

#include "SDL.h"

int SDL_FillRect(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);

Description

This function performs a fast fill of the given rectangle with +color. If dstrect +is NULL, the whole surface will be filled with +color.

The color should be a pixel of the format used by the surface, and +can be generated by the +SDL_MapRGB or SDL_MapRGBA +functions. If the color value contains an alpha value then the +destination is simply "filled" with that alpha information, no blending +takes place.

If there is a clip rectangle set on the destination (set via +SDL_SetClipRect) then this +function will clip based on the intersection of the clip rectangle and +the dstrect rectangle and the dstrect rectangle +will be modified to represent the area actually filled.

Return Value

This function returns 0 on success, or +-1 on error.


PrevHomeNext
SDL_BlitSurfaceUpSDL_DisplayFormat
\ No newline at end of file diff --git a/docs/html/sdlflip.html b/docs/html/sdlflip.html new file mode 100644 index 0000000..b480f99 --- /dev/null +++ b/docs/html/sdlflip.html @@ -0,0 +1,259 @@ +SDL_Flip
SDL Library Documentation
PrevNext

SDL_Flip

Name

SDL_Flip -- Swaps screen buffers

Synopsis

#include "SDL.h"

int SDL_Flip(SDL_Surface *screen);

Description

On hardware that supports double-buffering, this function sets up a flip +and returns. The hardware will wait for vertical retrace, and then swap +video buffers before the next video surface blit or lock will return. +On hardware that doesn't support double-buffering, this is equivalent +to calling SDL_UpdateRect(screen, 0, 0, 0, 0)

The SDL_DOUBLEBUF flag must have been passed to +SDL_SetVideoMode, + when +setting the video mode for this function to perform hardware flipping.

Return Value

This function returns 0 if successful, or +-1 if there was an error.


PrevHomeNext
SDL_UpdateRectsUpSDL_SetColors
\ No newline at end of file diff --git a/docs/html/sdlfreecursor.html b/docs/html/sdlfreecursor.html new file mode 100644 index 0000000..01a4f7c --- /dev/null +++ b/docs/html/sdlfreecursor.html @@ -0,0 +1,209 @@ +SDL_FreeCursor
SDL Library Documentation
PrevNext

SDL_FreeCursor

Name

SDL_FreeCursor -- Frees a cursor created with SDL_CreateCursor.

Synopsis

#include "SDL.h"

void SDL_FreeCursor(SDL_Cursor *cursor);

Description

Frees a SDL_Cursor that was created using +SDL_CreateCursor.


PrevHomeNext
SDL_CreateCursorUpSDL_SetCursor
\ No newline at end of file diff --git a/docs/html/sdlfreesurface.html b/docs/html/sdlfreesurface.html new file mode 100644 index 0000000..84b6048 --- /dev/null +++ b/docs/html/sdlfreesurface.html @@ -0,0 +1,219 @@ +SDL_FreeSurface
SDL Library Documentation
PrevNext

SDL_FreeSurface

Name

SDL_FreeSurface -- Frees (deletes) a SDL_Surface

Synopsis

#include "SDL.h"

void SDL_FreeSurface(SDL_Surface *surface);

Description

Frees the resources used by a previously created SDL_Surface. If the surface was created using +SDL_CreateRGBSurfaceFrom then the pixel data is not freed.


PrevHomeNext
SDL_CreateRGBSurfaceFromUpSDL_LockSurface
\ No newline at end of file diff --git a/docs/html/sdlfreewav.html b/docs/html/sdlfreewav.html new file mode 100644 index 0000000..24242c4 --- /dev/null +++ b/docs/html/sdlfreewav.html @@ -0,0 +1,222 @@ +SDL_FreeWAV
SDL Library Documentation
PrevNext

SDL_FreeWAV

Name

SDL_FreeWAV -- Frees previously opened WAV data

Synopsis

#include "SDL.h"

void SDL_FreeWAV(Uint8 *audio_buf);

Description

After a WAVE file has been opened with SDL_LoadWAV its data can eventually be freed with SDL_FreeWAV. audio_buf is a pointer to the buffer created by SDL_LoadWAV.

See Also

SDL_LoadWAV


PrevHomeNext
SDL_LoadWAVUpSDL_AudioCVT
\ No newline at end of file diff --git a/docs/html/sdlfreeyuvoverlay.html b/docs/html/sdlfreeyuvoverlay.html new file mode 100644 index 0000000..e82340d --- /dev/null +++ b/docs/html/sdlfreeyuvoverlay.html @@ -0,0 +1,233 @@ +SDL_FreeYUVOverlay
SDL Library Documentation
PrevNext

SDL_FreeYUVOverlay

Name

SDL_FreeYUVOverlay -- Free a YUV video overlay

Synopsis

#include "SDL.h"

void SDL_FreeYUVOverlay(SDL_Overlay *overlay);

Description

Frees and overlay created by SDL_CreateYUVOverlay.


PrevHomeNext
SDL_DisplayYUVOverlayUpSDL_GLattr
\ No newline at end of file diff --git a/docs/html/sdlgetappstate.html b/docs/html/sdlgetappstate.html new file mode 100644 index 0000000..d09e2e0 --- /dev/null +++ b/docs/html/sdlgetappstate.html @@ -0,0 +1,263 @@ +SDL_GetAppState
SDL Library Documentation
PrevNext

SDL_GetAppState

Name

SDL_GetAppState -- Get the state of the application

Synopsis

#include "SDL.h"

Uint8 SDL_GetAppState(void);

Description

This function returns the current state of the application. The value returned is a bitwise combination of:

SDL_APPMOUSEFOCUSThe application has mouse focus.
SDL_APPINPUTFOCUSThe application has keyboard focus
SDL_APPACTIVEThe application is visible


PrevHomeNext
SDL_GetRelativeMouseStateUpSDL_JoystickEventState
\ No newline at end of file diff --git a/docs/html/sdlgetaudiostatus.html b/docs/html/sdlgetaudiostatus.html new file mode 100644 index 0000000..3fc3a09 --- /dev/null +++ b/docs/html/sdlgetaudiostatus.html @@ -0,0 +1,221 @@ +SDL_GetAudioStatus
SDL Library Documentation
PrevNext

SDL_GetAudioStatus

Name

SDL_GetAudioStatus -- Get the current audio state

Synopsis

#include "SDL.h"

SDL_audiostatusSDL_GetAudioStatus(void);

Description

typedef enum{
+  SDL_AUDIO_STOPPED,
+  SDL_AUDIO_PAUSED,
+  SDL_AUDIO_PLAYING
+} SDL_audiostatus;

Returns either SDL_AUDIO_STOPPED, SDL_AUDIO_PAUSED or SDL_AUDIO_PLAYING depending on the current audio state.


PrevHomeNext
SDL_PauseAudioUpSDL_LoadWAV
\ No newline at end of file diff --git a/docs/html/sdlgetcliprect.html b/docs/html/sdlgetcliprect.html new file mode 100644 index 0000000..f00ac77 --- /dev/null +++ b/docs/html/sdlgetcliprect.html @@ -0,0 +1,229 @@ +SDL_GetClipRect
SDL Library Documentation
PrevNext

SDL_GetClipRect

Name

SDL_GetClipRect -- Gets the clipping rectangle for a surface.

Synopsis

#include "SDL.h"

void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect);

Description

Gets the clipping rectangle for a surface. When this surface is the +destination of a blit, only the area within the clip rectangle is +drawn into.

The rectangle pointed to by rect will be +filled with the clipping rectangle of the surface.


PrevHomeNext
SDL_SetClipRectUpSDL_ConvertSurface
\ No newline at end of file diff --git a/docs/html/sdlgetcursor.html b/docs/html/sdlgetcursor.html new file mode 100644 index 0000000..72ecbc7 --- /dev/null +++ b/docs/html/sdlgetcursor.html @@ -0,0 +1,219 @@ +SDL_GetCursor
SDL Library Documentation
PrevNext

SDL_GetCursor

Name

SDL_GetCursor -- Get the currently active mouse cursor.

Synopsis

#include "SDL.h"

SDL_Cursor *SDL_GetCursor(void);

Description

Returns the currently active mouse cursor.


PrevHomeNext
SDL_SetCursorUpSDL_ShowCursor
\ No newline at end of file diff --git a/docs/html/sdlgeterror.html b/docs/html/sdlgeterror.html new file mode 100644 index 0000000..cdf5792 --- /dev/null +++ b/docs/html/sdlgeterror.html @@ -0,0 +1,205 @@ +SDL_GetError
SDL Library Documentation
PrevNext

SDL_GetError

Name

SDL_GetError -- Get SDL error string

Synopsis

#include "SDL/SDL.h"

char *SDL_GetError(void);

Description

SDL_GetError returns a NULL terminated string containing information about the last internal SDL error.

Return Value

SDL_GetError returns a string containing the last error.


PrevHomeNext
SDL_WasInitUpSDL_envvars
\ No newline at end of file diff --git a/docs/html/sdlgeteventfilter.html b/docs/html/sdlgeteventfilter.html new file mode 100644 index 0000000..d254d34 --- /dev/null +++ b/docs/html/sdlgeteventfilter.html @@ -0,0 +1,235 @@ +SDL_GetEventFilter
SDL Library Documentation
PrevNext

SDL_GetEventFilter

Name

SDL_GetEventFilter -- Retrieves a pointer to he event filter

Synopsis

#include "SDL.h"

SDL_EventFilter SDL_GetEventFilter(void);

Description

This function retrieces a pointer to the event filter that was previously set using SDL_SetEventFilter. An SDL_EventFilter function is defined as: +

typedef int (*SDL_EventFilter)(const SDL_Event *event);

Return Value

Returns a pointer to the event filter or NULL if no filter has been set.


PrevHomeNext
SDL_SetEventFilterUpSDL_EventState
\ No newline at end of file diff --git a/docs/html/sdlgetgammaramp.html b/docs/html/sdlgetgammaramp.html new file mode 100644 index 0000000..bfcc03c --- /dev/null +++ b/docs/html/sdlgetgammaramp.html @@ -0,0 +1,219 @@ +SDL_GetGammaRamp
SDL Library Documentation
PrevNext

SDL_GetGammaRamp

Name

SDL_GetGammaRamp -- Gets the color gamma lookup tables for the display

Synopsis

#include "SDL.h"

int SDL_GetGammaRamp(Uint16 *redtable, Uint16 *greentable, Uint16 *bluetable);

Description

Gets the gamma translation lookup tables currently used by the display. +Each table is an array of 256 Uint16 values.

Not all display hardware is able to change gamma.

Return Value

Returns -1 on error.


PrevHomeNext
SDL_SetGammaUpSDL_SetGammaRamp
\ No newline at end of file diff --git a/docs/html/sdlgetkeyname.html b/docs/html/sdlgetkeyname.html new file mode 100644 index 0000000..6c51c94 --- /dev/null +++ b/docs/html/sdlgetkeyname.html @@ -0,0 +1,216 @@ +SDL_GetKeyName
SDL Library Documentation
PrevNext

SDL_GetKeyName

Name

SDL_GetKeyName -- Get the name of an SDL virtual keysym

Synopsis

#include "SDL.h"

char *SDL_GetKeyName(SDLKey key);

Description

Returns the SDL-defined name of the SDLKey key.

See Also

SDLKey


PrevHomeNext
SDL_SetModStateUpSDL_EnableUNICODE
\ No newline at end of file diff --git a/docs/html/sdlgetkeystate.html b/docs/html/sdlgetkeystate.html new file mode 100644 index 0000000..1c16f2e --- /dev/null +++ b/docs/html/sdlgetkeystate.html @@ -0,0 +1,253 @@ +SDL_GetKeyState
SDL Library Documentation
PrevNext

SDL_GetKeyState

Name

SDL_GetKeyState -- Get a snapshot of the current keyboard state

Synopsis

#include "SDL.h"

Uint8 *SDL_GetKeyState(int *numkeys);

Description

Gets a snapshot of the current keyboard state. The current state is return as a pointer to an array, the size of this array is stored in numkeys. The array is indexed by the SDLK_* symbols. A value of 1 means the key is pressed and a value of 0 means its not. The pointer returned is a pointer to an internal SDL array and should not be freed by the caller.

Note: Use SDL_PumpEvents to update the state array.

Example

Uint8 *keystate = SDL_GetKeyState(NULL);
+if ( keystate[SDLK_RETURN] ) printf("Return Key Pressed.\n");


PrevHomeNext
SDL_EventStateUpSDL_GetModState
\ No newline at end of file diff --git a/docs/html/sdlgetmodstate.html b/docs/html/sdlgetmodstate.html new file mode 100644 index 0000000..64d2f35 --- /dev/null +++ b/docs/html/sdlgetmodstate.html @@ -0,0 +1,257 @@ +SDL_GetModState
SDL Library Documentation
PrevNext

SDL_GetModState

Name

SDL_GetModState -- Get the state of modifier keys.

Synopsis

#include "SDL.h"

SDLMod SDL_GetModState(void);

Description

Returns the current state of the modifier keys (CTRL, ALT, etc.).

Return Value

The return value can be an OR'd combination of the SDLMod enum.

SDLMod

typedef enum {
+  KMOD_NONE  = 0x0000,
+  KMOD_LSHIFT= 0x0001,
+  KMOD_RSHIFT= 0x0002,
+  KMOD_LCTRL = 0x0040,
+  KMOD_RCTRL = 0x0080,
+  KMOD_LALT  = 0x0100,
+  KMOD_RALT  = 0x0200,
+  KMOD_LMETA = 0x0400,
+  KMOD_RMETA = 0x0800,
+  KMOD_NUM   = 0x1000,
+  KMOD_CAPS  = 0x2000,
+  KMOD_MODE  = 0x4000,
+} SDLMod;
+SDL also defines the following symbols for convenience: +
#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
+#define KMOD_SHIFT  (KMOD_LSHIFT|KMOD_RSHIFT)
+#define KMOD_ALT  (KMOD_LALT|KMOD_RALT)
+#define KMOD_META (KMOD_LMETA|KMOD_RMETA)


PrevHomeNext
SDL_GetKeyStateUpSDL_SetModState
\ No newline at end of file diff --git a/docs/html/sdlgetmousestate.html b/docs/html/sdlgetmousestate.html new file mode 100644 index 0000000..d96a55b --- /dev/null +++ b/docs/html/sdlgetmousestate.html @@ -0,0 +1,253 @@ +SDL_GetMouseState
SDL Library Documentation
PrevNext

SDL_GetMouseState

Name

SDL_GetMouseState -- Retrieve the current state of the mouse

Synopsis

#include "SDL.h"

Uint8 SDL_GetMouseState(int *x, int *y);

Description

The current button state is returned as a button bitmask, which can +be tested using the SDL_BUTTON(X) macros, and x and y are set to the +current mouse cursor position. You can pass NULL for either x or y.

Example

SDL_PumpEvents();
+if(SDL_GetMouseState(NULL, NULL)&SDL_BUTTON(1))
+  printf("Mouse Button 1(left) is pressed.\n");

PrevHomeNext
SDL_EnableKeyRepeatUpSDL_GetRelativeMouseState
\ No newline at end of file diff --git a/docs/html/sdlgetrelativemousestate.html b/docs/html/sdlgetrelativemousestate.html new file mode 100644 index 0000000..52a5106 --- /dev/null +++ b/docs/html/sdlgetrelativemousestate.html @@ -0,0 +1,235 @@ +SDL_GetRelativeMouseState
SDL Library Documentation
PrevNext

SDL_GetRelativeMouseState

Name

SDL_GetRelativeMouseState -- Retrieve the current state of the mouse

Synopsis

#include "SDL.h"

Uint8 SDL_GetRelativeMouseState(int *x, int *y);

Description

The current button state is returned as a button bitmask, which can +be tested using the SDL_BUTTON(X) macros, and x and y are set to the change in the mouse position since the last call to SDL_GetRelativeMouseState or since event initialization. You can pass NULL for either x or y.


PrevHomeNext
SDL_GetMouseStateUpSDL_GetAppState
\ No newline at end of file diff --git a/docs/html/sdlgetrgb.html b/docs/html/sdlgetrgb.html new file mode 100644 index 0000000..47774dc --- /dev/null +++ b/docs/html/sdlgetrgb.html @@ -0,0 +1,231 @@ +SDL_GetRGB
SDL Library Documentation
PrevNext

SDL_GetRGB

Name

SDL_GetRGB -- Get RGB values from a pixel in the specified pixel format.

Synopsis

#include "SDL.h"

void SDL_GetRGB(Uint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, Uint8 *g, Uint8 *b);

Description

Get RGB component values from a pixel stored in the specified pixel format.

This function uses the entire 8-bit [0..255] range when converting color +components from pixel formats with less than 8-bits per RGB component +(e.g., a completely white pixel in 16-bit RGB565 format would return +[0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).


PrevHomeNext
SDL_MapRGBAUpSDL_GetRGBA
\ No newline at end of file diff --git a/docs/html/sdlgetrgba.html b/docs/html/sdlgetrgba.html new file mode 100644 index 0000000..a9e1093 --- /dev/null +++ b/docs/html/sdlgetrgba.html @@ -0,0 +1,222 @@ +SDL_GetRGBA
SDL Library Documentation
PrevNext

SDL_GetRGBA

Name

SDL_GetRGBA -- Get RGBA values from a pixel in the specified pixel format.

Synopsis

#include "SDL.h"

void SDL_GetRGBA(Uint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);

Description

Get RGBA component values from a pixel stored in the specified pixel format.

This function uses the entire 8-bit [0..255] range when converting color +components from pixel formats with less than 8-bits per RGB component +(e.g., a completely white pixel in 16-bit RGB565 format would return +[0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).

If the surface has no alpha component, the alpha will be returned as 0xff +(100% opaque).


PrevHomeNext
SDL_GetRGBUpSDL_CreateRGBSurface
\ No newline at end of file diff --git a/docs/html/sdlgetthreadid.html b/docs/html/sdlgetthreadid.html new file mode 100644 index 0000000..4bc59cb --- /dev/null +++ b/docs/html/sdlgetthreadid.html @@ -0,0 +1,209 @@ +SDL_GetThreadID
SDL Library Documentation
PrevNext

SDL_GetThreadID

Name

SDL_GetThreadID -- Get the SDL thread ID of a SDL_Thread

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

Uint32 SDL_GetThreadID(SDL_Thread *thread);

Description

Returns the ID of a SDL_Thread created by SDL_CreateThread.


PrevHomeNext
SDL_ThreadIDUpSDL_WaitThread
\ No newline at end of file diff --git a/docs/html/sdlgetticks.html b/docs/html/sdlgetticks.html new file mode 100644 index 0000000..0911aae --- /dev/null +++ b/docs/html/sdlgetticks.html @@ -0,0 +1,206 @@ +SDL_GetTicks
SDL Library Documentation
PrevNext

SDL_GetTicks

Name

SDL_GetTicks -- Get the number of milliseconds since the SDL library initialization.

Synopsis

#include "SDL.h"

Uint32 SDL_GetTicks(void);

Description

Get the number of milliseconds since the SDL library initialization. +Note that this value wraps if the program runs for more than ~49 days.

See Also

SDL_Delay


PrevHomeNext
TimeUpSDL_Delay
\ No newline at end of file diff --git a/docs/html/sdlgetvideoinfo.html b/docs/html/sdlgetvideoinfo.html new file mode 100644 index 0000000..25c4b45 --- /dev/null +++ b/docs/html/sdlgetvideoinfo.html @@ -0,0 +1,226 @@ +SDL_GetVideoInfo
SDL Library Documentation
PrevNext

SDL_GetVideoInfo

Name

SDL_GetVideoInfo -- returns a pointer to information about the video hardware

Synopsis

#include "SDL.h"

SDL_VideoInfo *SDL_GetVideoInfo(void);

Description

This function returns a read-only pointer to information about the video +hardware. If this is called before SDL_SetVideoMode, the +vfmt member of the returned structure will contain the +pixel format of the "best" video mode.


PrevHomeNext
SDL_GetVideoSurfaceUpSDL_VideoDriverName
\ No newline at end of file diff --git a/docs/html/sdlgetvideosurface.html b/docs/html/sdlgetvideosurface.html new file mode 100644 index 0000000..905b1f6 --- /dev/null +++ b/docs/html/sdlgetvideosurface.html @@ -0,0 +1,208 @@ +SDL_GetVideoSurface
SDL Library Documentation
PrevNext

SDL_GetVideoSurface

Name

SDL_GetVideoSurface -- returns a pointer to the current display surface

Synopsis

#include "SDL.h"

SDL_Surface *SDL_GetVideoSurface(void);

Description

This function returns a pointer to the current display surface. +If SDL is doing format conversion on the display surface, this +function returns the publicly visible surface, not the real video +surface.

See Also

SDL_Surface


PrevHomeNext
VideoUpSDL_GetVideoInfo
\ No newline at end of file diff --git a/docs/html/sdlglattr.html b/docs/html/sdlglattr.html new file mode 100644 index 0000000..0ae0127 --- /dev/null +++ b/docs/html/sdlglattr.html @@ -0,0 +1,379 @@ +SDL_GLattr
SDL Library Documentation
PrevNext

SDL_GLattr

Name

SDL_GLattr -- SDL GL Attributes

Attributes

SDL_GL_RED_SIZESize of the framebuffer red component, in bits
SDL_GL_GREEN_SIZESize of the framebuffer green component, in bits
SDL_GL_BLUE_SIZESize of the framebuffer blue component, in bits
SDL_GL_ALPHA_SIZESize of the framebuffer alpha component, in bits
SDL_GL_DOUBLEBUFFER0 or 1, enable or disable double buffering
SDL_GL_BUFFER_SIZESize of the framebuffer, in bits
SDL_GL_DEPTH_SIZESize of the depth buffer, in bits
SDL_GL_STENCIL_SIZESize of the stencil buffer, in bits
SDL_GL_ACCUM_RED_SIZESize of the accumulation buffer red component, in bits
SDL_GL_ACCUM_GREEN_SIZESize of the accumulation buffer green component, in bits
SDL_GL_ACCUM_BLUE_SIZESize of the accumulation buffer blue component, in bits
SDL_GL_ACCUM_ALPHA_SIZESize of the accumulation buffer alpha component, in bits

Description

While you can set most OpenGL attributes normally, the attributes list above must be known before SDL sets the video mode. These attributes a set and read with SDL_GL_SetAttribute and SDL_GL_GetAttribute.


PrevHomeNext
SDL_FreeYUVOverlayUpSDL_Rect
\ No newline at end of file diff --git a/docs/html/sdlglgetattribute.html b/docs/html/sdlglgetattribute.html new file mode 100644 index 0000000..26c8913 --- /dev/null +++ b/docs/html/sdlglgetattribute.html @@ -0,0 +1,247 @@ +SDL_GL_GetAttribute
SDL Library Documentation
PrevNext

SDL_GL_GetAttribute

Name

SDL_GL_GetAttribute -- Get the value of a special SDL/OpenGL attribute

Synopsis

#include "SDL.h"

int SDL_GL_GetAttribute(SDLGLattr attr, int *value);

Description

Places the value of the SDL/OpenGL attribute attr into value. This is useful after a call to SDL_SetVideoMode to check whether your attributes have been set as you expected.

Return Value

Returns 0 on success, or -1 on an error.


PrevHomeNext
SDL_GL_GetProcAddressUpSDL_GL_SetAttribute
\ No newline at end of file diff --git a/docs/html/sdlglgetprocaddress.html b/docs/html/sdlglgetprocaddress.html new file mode 100644 index 0000000..a6cf6e4 --- /dev/null +++ b/docs/html/sdlglgetprocaddress.html @@ -0,0 +1,262 @@ +SDL_GL_GetProcAddress
SDL Library Documentation
PrevNext

SDL_GL_GetProcAddress

Name

SDL_GL_GetProcAddress -- Get the address of a GL function

Synopsis

#include "SDL.h"

void *SDL_GL_GetProcAddress(const char* proc);

Description

Returns the address of the GL function proc, or NULL if the function is not found. If the GL library is loaded at runtime, with SDL_GL_LoadLibrary, then all GL functions must be retrieved this way. Usually this is used to retrieve function pointers to OpenGL extensions.

Example

typedef void (*GL_ActiveTextureARB_Func)(unsigned int);
+GL_ActiveTextureARB_Func glActiveTextureARB_ptr = 0;
+int has_multitexture=1;
+.
+.
+.
+/* Get function pointer */
+glActiveTextureARB_ptr=(GL_ActiveTextureARB_Func) SDL_GL_GetProcAddress("glActiveTextureARB");
+
+/* Check for a valid function ptr */
+if(!glActiveTextureARB_ptr){
+  fprintf(stderr, "Multitexture Extensions not present.\n");
+  has_multitexture=0;
+}
+.
+.
+.
+.
+if(has_multitexture){
+  glActiveTextureARB_ptr(GL_TEXTURE0_ARB);
+  .
+  .
+}
+else{
+  .
+  .
+}

PrevHomeNext
SDL_GL_LoadLibraryUpSDL_GL_GetAttribute
\ No newline at end of file diff --git a/docs/html/sdlglloadlibrary.html b/docs/html/sdlglloadlibrary.html new file mode 100644 index 0000000..d3c4c6d --- /dev/null +++ b/docs/html/sdlglloadlibrary.html @@ -0,0 +1,231 @@ +SDL_GL_LoadLibrary
SDL Library Documentation
PrevNext

SDL_GL_LoadLibrary

Name

SDL_GL_LoadLibrary -- Specify an OpenGL library

Synopsis

#include "SDL.h"

int SDL_GL_LoadLibrary(const char *path);

Description

If you wish, you may load the OpenGL library at runtime, this must be done before SDL_SetVideoMode is called. The path of the GL library is passed to SDL_GL_LoadLibrary and it returns 0 on success, or -1 on an error. You must then use SDL_GL_GetProcAddress to retrieve function pointers to GL functions.


PrevHomeNext
SDL_ShowCursorUpSDL_GL_GetProcAddress
\ No newline at end of file diff --git a/docs/html/sdlglsetattribute.html b/docs/html/sdlglsetattribute.html new file mode 100644 index 0000000..ffb1204 --- /dev/null +++ b/docs/html/sdlglsetattribute.html @@ -0,0 +1,286 @@ +SDL_GL_SetAttribute
SDL Library Documentation
PrevNext

SDL_GL_SetAttribute

Name

SDL_GL_SetAttribute -- Set a special SDL/OpenGL attribute

Synopsis

#include "SDL.h"

int SDL_GL_SetAttribute(SDL_GLattr attr, int value);

Description

Sets the OpenGL attribute attr to value. The attributes you set don't take effect until after a call to SDL_SetVideoMode. You should use SDL_GL_GetAttribute to check the values after a SDL_SetVideoMode call.

Return Value

Returns 0 on success, or -1 on error.

Example

SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
+SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
+SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
+SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
+SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
+if ( (screen=SDL_SetVideoMode( 640, 480, 16, SDL_OPENGL )) == NULL ) {
+  fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError());
+  SDL_Quit();
+  return;
+}

Note: The SDL_DOUBLEBUF flag is not required to enable double buffering when setting an OpenGL video mode. Double buffering is enabled or disabled using the SDL_GL_DOUBLEBUFFER attribute.


PrevHomeNext
SDL_GL_GetAttributeUpSDL_GL_SwapBuffers
\ No newline at end of file diff --git a/docs/html/sdlglswapbuffers.html b/docs/html/sdlglswapbuffers.html new file mode 100644 index 0000000..fa38341 --- /dev/null +++ b/docs/html/sdlglswapbuffers.html @@ -0,0 +1,212 @@ +SDL_GL_SwapBuffers
SDL Library Documentation
PrevNext

SDL_GL_SwapBuffers

Name

SDL_GL_SwapBuffers -- Swap OpenGL framebuffers/Update Display

Synopsis

#include "SDL.h"

void SDL_GL_SwapBuffers(void );

Description

Swap the OpenGL buffers, if double-buffering is supported.


PrevHomeNext
SDL_GL_SetAttributeUpSDL_CreateYUVOverlay
\ No newline at end of file diff --git a/docs/html/sdlinit.html b/docs/html/sdlinit.html new file mode 100644 index 0000000..11f27b8 --- /dev/null +++ b/docs/html/sdlinit.html @@ -0,0 +1,368 @@ +SDL_Init
SDL Library Documentation
PrevNext

SDL_Init

Name

SDL_Init -- Initializes SDL

Synopsis

#include "SDL.h"

int SDL_Init(Uint32 flags);

Description

Initializes SDL. This should be called before all other SDL functions. The flags parameter specifies what part(s) of SDL to initialize.

SDL_INIT_TIMERInitializes the timer subsystem.
SDL_INIT_AUDIOInitializes the audio subsystem.
SDL_INIT_VIDEOInitializes the video subsystem.
SDL_INIT_CDROMInitializes the cdrom subsystem.
SDL_INIT_JOYSTICKInitializes the joystick subsystem.
SDL_INIT_EVERYTHINGInitialize all of the above.
SDL_INIT_NOPARACHUTEPrevents SDL from catching fatal signals.
SDL_INIT_EVENTTHREAD 

Return Value

Returns -1 on an error or 0 on success.


PrevHomeNext
GeneralUpSDL_InitSubSystem
\ No newline at end of file diff --git a/docs/html/sdlinitsubsystem.html b/docs/html/sdlinitsubsystem.html new file mode 100644 index 0000000..917fd10 --- /dev/null +++ b/docs/html/sdlinitsubsystem.html @@ -0,0 +1,283 @@ +SDL_InitSubSystem
SDL Library Documentation
PrevNext

SDL_InitSubSystem

Name

SDL_InitSubSystem -- Initialize subsystems

Synopsis

#include "SDL.h"

int SDL_InitSubSystem(Uint32 flags);

Description

After SDL has been initialized with SDL_Init you may initialize uninitialized subsystems with SDL_InitSubSystem. The flags parameter is the same as that used in SDL_Init.

Examples

/* Seperating Joystick and Video initialization. */
+SDL_Init(SDL_INIT_VIDEO);
+.
+.
+SDL_SetVideoMode(640, 480, 16, SDL_DOUBLEBUF|SDL_FULLSCREEN);
+.
+/* Do Some Video stuff */
+.
+.
+/* Initialize the joystick subsystem */
+SDL_InitSubSystem(SDL_INIT_JOYSTICK);
+
+/* Do some stuff with video and joystick */
+.
+.
+.
+/* Shut them both down */
+SDL_Quit();

Return Value

Returns -1 on an error or 0 on success.


PrevHomeNext
SDL_InitUpSDL_QuitSubSystem
\ No newline at end of file diff --git a/docs/html/sdljoyaxisevent.html b/docs/html/sdljoyaxisevent.html new file mode 100644 index 0000000..9f01669 --- /dev/null +++ b/docs/html/sdljoyaxisevent.html @@ -0,0 +1,330 @@ +SDL_JoyAxisEvent
SDL Library Documentation
PrevNext

SDL_JoyAxisEvent

Name

SDL_JoyAxisEvent -- Joystick axis motion event structure

Structure Definition

typedef struct{
+  Uint8 type;
+  Uint8 which;
+  Uint8 axis;
+  Sint16 value;
+} SDL_JoyAxisEvent;

Structure Data

typeSDL_JOYAXISMOTION
whichJoystick device index
axisJoystick axis index
valueAxis value (range: -32768 to 32767)

Description

SDL_JoyAxisEvent is a member of the SDL_Event union and is used when an event of type SDL_JOYAXISMOTION is reported.

A SDL_JOYAXISMOTION event occurs when ever a user moves an axis on the joystick. The field which is the index of the joystick that reported the event and axis is the index of the axis (for a more detailed explaination see the Joystick section). value is the current position of the axis.


PrevHomeNext
SDL_MouseButtonEventUpSDL_JoyButtonEvent
\ No newline at end of file diff --git a/docs/html/sdljoyballevent.html b/docs/html/sdljoyballevent.html new file mode 100644 index 0000000..4ab96fe --- /dev/null +++ b/docs/html/sdljoyballevent.html @@ -0,0 +1,340 @@ +SDL_JoyBallEvent
SDL Library Documentation
PrevNext

SDL_JoyBallEvent

Name

SDL_JoyBallEvent -- Joystick trackball motion event structure

Structure Definition

typedef struct{
+  Uint8 type;
+  Uint8 which;
+  Uint8 ball;
+  Sint16 xrel, yrel;
+} SDL_JoyBallEvent;

Structure Data

typeSDL_JOYBALLMOTION
whichJoystick device index
ballJoystick trackball index
xrel, yrelThe relative motion in the X/Y direction

Description

SDL_JoyBallEvent is a member of the SDL_Event union and is used when an event of type SDL_JOYBALLMOTION is reported.

A SDL_JOYBALLMOTION event occurs when a user moves a trackball on the joystick. The field which is the index of the joystick that reported the event and ball is the index of the trackball (for a more detailed explaination see the Joystick section). Trackballs only return relative motion, this is the change in position on the ball since it was last polled (last cycle of the event loop) and it is stored in xrel and yrel.


PrevHomeNext
SDL_JoyHatEventUpSDL_ResizeEvent
\ No newline at end of file diff --git a/docs/html/sdljoybuttonevent.html b/docs/html/sdljoybuttonevent.html new file mode 100644 index 0000000..d1d9c1e --- /dev/null +++ b/docs/html/sdljoybuttonevent.html @@ -0,0 +1,351 @@ +SDL_JoyButtonEvent
SDL Library Documentation
PrevNext

SDL_JoyButtonEvent

Name

SDL_JoyButtonEvent -- Joystick button event structure

Structure Definition

typedef struct{
+  Uint8 type;
+  Uint8 which;
+  Uint8 button;
+  Uint8 state;
+} SDL_JoyButtonEvent;

Structure Data

typeSDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP
whichJoystick device index
buttonJoystick button index
stateSDL_PRESSED or SDL_RELEASED

Description

SDL_JoyButtonEvent is a member of the SDL_Event union and is used when an event of type SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP is reported.

A SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP event occurs when ever a user presses or releases a button on a joystick. The field which is the index of the joystick that reported the event and button is the index of the button (for a more detailed explaination see the Joystick section). state is the current state or the button which is either SDL_PRESSED or SDL_RELEASED.


PrevHomeNext
SDL_JoyAxisEventUpSDL_JoyHatEvent
\ No newline at end of file diff --git a/docs/html/sdljoyhatevent.html b/docs/html/sdljoyhatevent.html new file mode 100644 index 0000000..5e115be --- /dev/null +++ b/docs/html/sdljoyhatevent.html @@ -0,0 +1,413 @@ +SDL_JoyHatEvent
SDL Library Documentation
PrevNext

SDL_JoyHatEvent

Name

SDL_JoyHatEvent -- Joystick hat position change event structure

Structure Definition

typedef struct{
+  Uint8 type;
+  Uint8 which;
+  Uint8 hat;
+  Uint8 value;
+} SDL_JoyHatEvent;

Structure Data

typeSDL_JOY
whichJoystick device index
hatJoystick hat index
valueHat position

Description

SDL_JoyHatEvent is a member of the SDL_Event union and is used when an event of type SDL_JOYHATMOTION is reported.

A SDL_JOYHATMOTION event occurs when ever a user moves a hat on the joystick. The field which is the index of the joystick that reported the event and hat is the index of the hat (for a more detailed exlaination see the Joystick section). value is the current position of the hat. It is a logically OR'd combination of the following values (whose meanings should be pretty obvious:) :

SDL_HAT_CENTERED
SDL_HAT_UP
SDL_HAT_RIGHT
SDL_HAT_DOWN
SDL_HAT_LEFT

The following defines are also provided:

SDL_HAT_RIGHTUP
SDL_HAT_RIGHTDOWN
SDL_HAT_LEFTUP
SDL_HAT_LEFTDOWN


PrevHomeNext
SDL_JoyButtonEventUpSDL_JoyBallEvent
\ No newline at end of file diff --git a/docs/html/sdljoystickclose.html b/docs/html/sdljoystickclose.html new file mode 100644 index 0000000..efb44e0 --- /dev/null +++ b/docs/html/sdljoystickclose.html @@ -0,0 +1,223 @@ +SDL_JoystickClose
SDL Library Documentation
PrevNext

SDL_JoystickClose

Name

SDL_JoystickClose -- Closes a previously opened joystick

Synopsis

#include "SDL.h"

void SDL_JoystickClose(SDL_Joystick *joystick);

Description

Close a joystick that was previously opened with SDL_JoystickOpen.


PrevHomeNext
SDL_JoystickGetBallUpAudio
\ No newline at end of file diff --git a/docs/html/sdljoystickeventstate.html b/docs/html/sdljoystickeventstate.html new file mode 100644 index 0000000..11b148a --- /dev/null +++ b/docs/html/sdljoystickeventstate.html @@ -0,0 +1,290 @@ +SDL_JoystickEventState
SDL Library Documentation
PrevNext

SDL_JoystickEventState

Name

SDL_JoystickEventState -- Enable/disable joystick event polling

Synopsis

#include "SDL.h"

int SDL_JoystickEventState(int state);

Description

This function is used to enable or disable joystick event processing. With joystick event processing disabled you will have to update joystick states with SDL_JoystickUpdate and read the joystick information manually. state is either SDL_QUERY, SDL_ENABLE or SDL_IGNORE.

Note: Joystick event handling is prefered

Return Value

If state is SDL_QUERY then the current state is returned, otherwise the new processing state is returned.


PrevHomeNext
SDL_GetAppStateUpJoystick
\ No newline at end of file diff --git a/docs/html/sdljoystickgetaxis.html b/docs/html/sdljoystickgetaxis.html new file mode 100644 index 0000000..40a17b4 --- /dev/null +++ b/docs/html/sdljoystickgetaxis.html @@ -0,0 +1,271 @@ +SDL_JoystickGetAxis
SDL Library Documentation
PrevNext

SDL_JoystickGetAxis

Name

SDL_JoystickGetAxis -- Get the current state of an axis

Synopsis

#include "SDL.h"

Sint16 SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis);

Description

SDL_JoystickGetAxis returns the current state of the given axis on the given joystick.

On most modern joysticks the X axis is usually represented by axis 0 and the Y axis by axis 1. The value returned by SDL_JoystickGetAxis is a signed integer (-32768 to 32768) representing the current position of the axis, it maybe necessary to impose certain tolerances on these values to account for jitter. It is worth noting that some joysticks use axes 2 and 3 for extra buttons.

Return Value

Returns a 16-bit signed integer representing the current position of the axis.

Examples

Sint16 x_move, y_move;
+SDL_Joystick *joy1;
+.
+.
+x_move=SDL_JoystickGetAxis(joy1, 0);
+y_move=SDL_JoystickGetAxis(joy1, 1);


PrevHomeNext
SDL_JoystickUpdateUpSDL_JoystickGetHat
\ No newline at end of file diff --git a/docs/html/sdljoystickgetball.html b/docs/html/sdljoystickgetball.html new file mode 100644 index 0000000..0da252a --- /dev/null +++ b/docs/html/sdljoystickgetball.html @@ -0,0 +1,262 @@ +SDL_JoystickGetBall
SDL Library Documentation
PrevNext

SDL_JoystickGetBall

Name

SDL_JoystickGetBall -- Get relative trackball motion

Synopsis

#include "SDL.h"

int SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);

Description

Get the ball axis change.

Trackballs can only return relative motion since the last call to SDL_JoystickGetBall, these motion deltas a placed into dx and dy.

Return Value

Returns 0 on success or -1 on failure

Examples

int delta_x, delta_y;
+SDL_Joystick *joy;
+.
+.
+.
+SDL_JoystickUpdate();
+if(SDL_JoystickGetBall(joy, 0, &delta_x, &delta_y)==-1)
+  printf("TrackBall Read Error!\n");
+printf("Trackball Delta- X:%d, Y:%d\n", delta_x, delta_y);


PrevHomeNext
SDL_JoystickGetButtonUpSDL_JoystickClose
\ No newline at end of file diff --git a/docs/html/sdljoystickgetbutton.html b/docs/html/sdljoystickgetbutton.html new file mode 100644 index 0000000..680e356 --- /dev/null +++ b/docs/html/sdljoystickgetbutton.html @@ -0,0 +1,231 @@ +SDL_JoystickGetButton
SDL Library Documentation
PrevNext

SDL_JoystickGetButton

Name

SDL_JoystickGetButton -- Get the current state of a given button on a given joystick

Synopsis

#include "SDL.h"

Uint8 SDL_JoystickGetButton(SDL_Joystick *joystick, int button);

Description

SDL_JoystickGetButton returns the current state of the given button on the given joystick.

Return Value

1 if the button is pressed. Otherwise, 0.


PrevHomeNext
SDL_JoystickGetHatUpSDL_JoystickGetBall
\ No newline at end of file diff --git a/docs/html/sdljoystickgethat.html b/docs/html/sdljoystickgethat.html new file mode 100644 index 0000000..c638abb --- /dev/null +++ b/docs/html/sdljoystickgethat.html @@ -0,0 +1,297 @@ +SDL_JoystickGetHat
SDL Library Documentation
PrevNext

SDL_JoystickGetHat

Name

SDL_JoystickGetHat -- Get the current state of a joystick hat

Synopsis

#include "SDL.h"

Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat);

Description

SDL_JoystickGetHat returns the current state of the given hat on the given joystick.

Return Value

The current state is returned as a Uint8 which is defined as an OR'd combination of one or more of the following

SDL_HAT_CENTERED
SDL_HAT_UP
SDL_HAT_RIGHT
SDL_HAT_DOWN
SDL_HAT_LEFT
SDL_HAT_RIGHTUP
SDL_HAT_RIGHTDOWN
SDL_HAT_LEFTUP
SDL_HAT_LEFTDOWN


PrevHomeNext
SDL_JoystickGetAxisUpSDL_JoystickGetButton
\ No newline at end of file diff --git a/docs/html/sdljoystickindex.html b/docs/html/sdljoystickindex.html new file mode 100644 index 0000000..868a75a --- /dev/null +++ b/docs/html/sdljoystickindex.html @@ -0,0 +1,218 @@ +SDL_JoystickIndex
SDL Library Documentation
PrevNext

SDL_JoystickIndex

Name

SDL_JoystickIndex -- Get the index of an SDL_Joystick.

Synopsis

#include "SDL.h"

int SDL_JoystickIndex(SDL_Joystick *joystick);

Description

Returns the index of a given SDL_Joystick structure.

Return Value

Index number of the joystick.


PrevHomeNext
SDL_JoystickOpenedUpSDL_JoystickNumAxes
\ No newline at end of file diff --git a/docs/html/sdljoystickname.html b/docs/html/sdljoystickname.html new file mode 100644 index 0000000..0add817 --- /dev/null +++ b/docs/html/sdljoystickname.html @@ -0,0 +1,238 @@ +SDL_JoystickName
SDL Library Documentation
PrevNext

SDL_JoystickName

Name

SDL_JoystickName -- Get joystick name.

Synopsis

#include "SDL.h"

const char *SDL_JoystickName(int index);

Description

Get the implementation dependent name of joystick. The index parameter refers to the N'th joystick on the system.

Return Value

Returns a char pointer to the joystick name.

Examples

/* Print the names of all attached joysticks */
+int num_joy, i;
+num_joy=SDL_NumJoysticks();
+printf("%d joysticks found\n", num_joy);
+for(i=0;i<num_joy;i++)
+  printf("%s\n", SDL_JoystickName(i));


PrevHomeNext
SDL_NumJoysticksUpSDL_JoystickOpen
\ No newline at end of file diff --git a/docs/html/sdljoysticknumaxes.html b/docs/html/sdljoysticknumaxes.html new file mode 100644 index 0000000..53b67f5 --- /dev/null +++ b/docs/html/sdljoysticknumaxes.html @@ -0,0 +1,225 @@ +SDL_JoystickNumAxes
SDL Library Documentation
PrevNext

SDL_JoystickNumAxes

Name

SDL_JoystickNumAxes -- Get the number of joystick axes

Synopsis

#include "SDL.h"

int SDL_JoystickNumAxes(SDL_Joystick *joystick);

Description

Return the number of axes available from a previously opened SDL_Joystick.

Return Value

Number of axes.


PrevHomeNext
SDL_JoystickIndexUpSDL_JoystickNumBalls
\ No newline at end of file diff --git a/docs/html/sdljoysticknumballs.html b/docs/html/sdljoysticknumballs.html new file mode 100644 index 0000000..0a8405d --- /dev/null +++ b/docs/html/sdljoysticknumballs.html @@ -0,0 +1,225 @@ +SDL_JoystickNumBalls
SDL Library Documentation
PrevNext

SDL_JoystickNumBalls

Name

SDL_JoystickNumBalls -- Get the number of joystick trackballs

Synopsis

#include "SDL.h"

int SDL_JoystickNumBalls(SDL_Joystick *joystick);

Description

Return the number of trackballs available from a previously opened SDL_Joystick.

Return Value

Number of trackballs.


PrevHomeNext
SDL_JoystickNumAxesUpSDL_JoystickNumHats
\ No newline at end of file diff --git a/docs/html/sdljoysticknumbuttons.html b/docs/html/sdljoysticknumbuttons.html new file mode 100644 index 0000000..625b893 --- /dev/null +++ b/docs/html/sdljoysticknumbuttons.html @@ -0,0 +1,225 @@ +SDL_JoystickNumButtons
SDL Library Documentation
PrevNext

SDL_JoystickNumButtons

Name

SDL_JoystickNumButtons -- Get the number of joysitck buttons

Synopsis

#include "SDL.h"

int SDL_JoystickNumButtons(SDL_Joystick *joystick);

Description

Return the number of buttons available from a previously opened SDL_Joystick.

Return Value

Number of buttons.


PrevHomeNext
SDL_JoystickNumHatsUpSDL_JoystickUpdate
\ No newline at end of file diff --git a/docs/html/sdljoysticknumhats.html b/docs/html/sdljoysticknumhats.html new file mode 100644 index 0000000..ed53235 --- /dev/null +++ b/docs/html/sdljoysticknumhats.html @@ -0,0 +1,225 @@ +SDL_JoystickNumHats
SDL Library Documentation
PrevNext

SDL_JoystickNumHats

Name

SDL_JoystickNumHats -- Get the number of joystick hats

Synopsis

#include "SDL.h"

int SDL_JoystickNumHats(SDL_Joystick *joystick);

Description

Return the number of hats available from a previously opened SDL_Joystick.

Return Value

Number of hats.


PrevHomeNext
SDL_JoystickNumBallsUpSDL_JoystickNumButtons
\ No newline at end of file diff --git a/docs/html/sdljoystickopen.html b/docs/html/sdljoystickopen.html new file mode 100644 index 0000000..e608c43 --- /dev/null +++ b/docs/html/sdljoystickopen.html @@ -0,0 +1,259 @@ +SDL_JoystickOpen
SDL Library Documentation
PrevNext

SDL_JoystickOpen

Name

SDL_JoystickOpen -- Opens a joystick for use.

Synopsis

#include "SDL.h"

SDL_Joystick *SDL_JoystickOpen(int index);

Description

Opens a joystick for use within SDL. The index refers to the N'th joystick in the system. A joystick must be opened before it game be used.

Return Value

Returns a SDL_Joystick structure on success. NULL on failure.

Examples

SDL_Joystick *joy;
+// Check for joystick
+if(SDL_NumJoysticks()>0){
+  // Open joystick
+  joy=SDL_JoystickOpen(0);
+  
+  if(joy)
+  {
+    printf("Opened Joystick 0\n");
+    printf("Name: %s\n", SDL_JoystickName(0));
+    printf("Number of Axes: %d\n", SDL_JoystickNumAxes(joy));
+    printf("Number of Buttons: %d\n", SDL_JoystickNumButtons(joy));
+    printf("Number of Balls: %d\n", SDL_JoystickNumBalls(joy));
+  }
+  else
+    printf("Couldn't open Joystick 0\n");
+  
+  // Close if opened
+  if(SDL_JoystickOpened(0))
+    SDL_JoystickClose(joy);
+}


PrevHomeNext
SDL_JoystickNameUpSDL_JoystickOpened
\ No newline at end of file diff --git a/docs/html/sdljoystickopened.html b/docs/html/sdljoystickopened.html new file mode 100644 index 0000000..5275a09 --- /dev/null +++ b/docs/html/sdljoystickopened.html @@ -0,0 +1,233 @@ +SDL_JoystickOpened
SDL Library Documentation
PrevNext

SDL_JoystickOpened

Name

SDL_JoystickOpened -- Determine if a joystick has been opened

Synopsis

#include "SDL.h"

int SDL_JoystickOpened(int index);

Description

Determines whether a joystick has already been opened within the application. index refers to the N'th joystick on the system.

Return Value

Returns 1 if the joystick has been opened, or 0 if it has not.


PrevHomeNext
SDL_JoystickOpenUpSDL_JoystickIndex
\ No newline at end of file diff --git a/docs/html/sdljoystickupdate.html b/docs/html/sdljoystickupdate.html new file mode 100644 index 0000000..0cb37dc --- /dev/null +++ b/docs/html/sdljoystickupdate.html @@ -0,0 +1,211 @@ +SDL_JoystickUpdate
SDL Library Documentation
PrevNext

SDL_JoystickUpdate

Name

SDL_JoystickUpdate -- Updates the state of all joysticks

Synopsis

#include "SDL.h"

void SDL_JoystickUpdate(void);

Description

Updates the state(position, buttons, etc.) of all open joysticks. If joystick events have been enabled with SDL_JoystickEventState then this is called automatically in the event loop.


PrevHomeNext
SDL_JoystickNumButtonsUpSDL_JoystickGetAxis
\ No newline at end of file diff --git a/docs/html/sdlkey.html b/docs/html/sdlkey.html new file mode 100644 index 0000000..6591884 --- /dev/null +++ b/docs/html/sdlkey.html @@ -0,0 +1,2630 @@ +SDLKey
SDL Library Documentation
PrevNext

SDLKey

Name

SDLKey -- Keysym definitions.

Description

Table 8-1. SDL Keysym definitions

SDLKeyASCII valueCommon name
SDLK_BACKSPACE'\b'backspace
SDLK_TAB'\t'tab
SDLK_CLEAR clear
SDLK_RETURN'\r'return
SDLK_PAUSE pause
SDLK_ESCAPE'^['escape
SDLK_SPACE' 'space
SDLK_EXCLAIM'!'exclaim
SDLK_QUOTEDBL'"'quotedbl
SDLK_HASH'#'hash
SDLK_DOLLAR'$'dollar
SDLK_AMPERSAND'&'ampersand
SDLK_QUOTE'''quote
SDLK_LEFTPAREN'('left parenthesis
SDLK_RIGHTPAREN')'right parenthesis
SDLK_ASTERISK'*'asterisk
SDLK_PLUS'+'plus sign
SDLK_COMMA','comma
SDLK_MINUS'-'minus sign
SDLK_PERIOD'.'period
SDLK_SLASH'/'forward slash
SDLK_0'0'0
SDLK_1'1'1
SDLK_2'2'2
SDLK_3'3'3
SDLK_4'4'4
SDLK_5'5'5
SDLK_6'6'6
SDLK_7'7'7
SDLK_8'8'8
SDLK_9'9'9
SDLK_COLON':'colon
SDLK_SEMICOLON';'semicolon
SDLK_LESS'<'less-than sign
SDLK_EQUALS'='equals sign
SDLK_GREATER'>'greater-than sign
SDLK_QUESTION'?'question mark
SDLK_AT'@'at
SDLK_LEFTBRACKET'['left bracket
SDLK_BACKSLASH'\'backslash
SDLK_RIGHTBRACKET']'right bracket
SDLK_CARET'^'caret
SDLK_UNDERSCORE'_'underscore
SDLK_BACKQUOTE'`'grave
SDLK_a'a'a
SDLK_b'b'b
SDLK_c'c'c
SDLK_d'd'd
SDLK_e'e'e
SDLK_f'f'f
SDLK_g'g'g
SDLK_h'h'h
SDLK_i'i'i
SDLK_j'j'j
SDLK_k'k'k
SDLK_l'l'l
SDLK_m'm'm
SDLK_n'n'n
SDLK_o'o'o
SDLK_p'p'p
SDLK_q'q'q
SDLK_r'r'r
SDLK_s's's
SDLK_t't't
SDLK_u'u'u
SDLK_v'v'v
SDLK_w'w'w
SDLK_x'x'x
SDLK_y'y'y
SDLK_z'z'z
SDLK_DELETE'^?'delete
SDLK_KP0 keypad 0
SDLK_KP1 keypad 1
SDLK_KP2 keypad 2
SDLK_KP3 keypad 3
SDLK_KP4 keypad 4
SDLK_KP5 keypad 5
SDLK_KP6 keypad 6
SDLK_KP7 keypad 7
SDLK_KP8 keypad 8
SDLK_KP9 keypad 9
SDLK_KP_PERIOD'.'keypad period
SDLK_KP_DIVIDE'/'keypad divide
SDLK_KP_MULTIPLY'*'keypad multiply
SDLK_KP_MINUS'-'keypad minus
SDLK_KP_PLUS'+'keypad plus
SDLK_KP_ENTER'\r'keypad enter
SDLK_KP_EQUALS'='keypad equals
SDLK_UP up arrow
SDLK_DOWN down arrow
SDLK_RIGHT right arrow
SDLK_LEFT left arrow
SDLK_INSERT insert
SDLK_HOME home
SDLK_END end
SDLK_PAGEUP page up
SDLK_PAGEDOWN page down
SDLK_F1 F1
SDLK_F2 F2
SDLK_F3 F3
SDLK_F4 F4
SDLK_F5 F5
SDLK_F6 F6
SDLK_F7 F7
SDLK_F8 F8
SDLK_F9 F9
SDLK_F10 F10
SDLK_F11 F11
SDLK_F12 F12
SDLK_F13 F13
SDLK_F14 F14
SDLK_F15 F15
SDLK_NUMLOCK numlock
SDLK_CAPSLOCK capslock
SDLK_SCROLLOCK scrollock
SDLK_RSHIFT right shift
SDLK_LSHIFT left shift
SDLK_RCTRL right ctrl
SDLK_LCTRL left ctrl
SDLK_RALT right alt
SDLK_LALT left alt
SDLK_RMETA right meta
SDLK_LMETA left meta
SDLK_LSUPER left windows key
SDLK_RSUPER right windows key
SDLK_MODE mode shift
SDLK_HELP help
SDLK_PRINT print-screen
SDLK_SYSREQ SysRq
SDLK_BREAK break
SDLK_MENU menu
SDLK_POWER power
SDLK_EURO euro
+ +

Table 8-2. SDL modifier definitions

SDL ModifierMeaning
KMOD_NONENo modifiers applicable
KMOD_NUMNumlock is down
KMOD_CAPSCapslock is down
KMOD_LCTRLLeft Control is down
KMOD_RCTRLRight Control is down
KMOD_RSHIFTRight Shift is down
KMOD_LSHIFTLeft Shift is down
KMOD_RALTRight Alt is down
KMOD_LALTLeft Alt is down
KMOD_CTRLA Control key is down
KMOD_SHIFTA Shift key is down
KMOD_ALTAn Alt key is down


PrevHomeNext
SDL_keysymUpEvent Functions.
\ No newline at end of file diff --git a/docs/html/sdlkeyboardevent.html b/docs/html/sdlkeyboardevent.html new file mode 100644 index 0000000..1a6962c --- /dev/null +++ b/docs/html/sdlkeyboardevent.html @@ -0,0 +1,375 @@ +SDL_KeyboardEvent
SDL Library Documentation
PrevNext

SDL_KeyboardEvent

Name

SDL_KeyboardEvent -- Keyboard event structure

Structure Definition

typedef struct{
+  Uint8 type;
+  Uint8 state;
+  SDL_keysym keysym;
+} SDL_KeyboardEvent;

Structure Data

typeSDL_KEYDOWN or SDL_KEYUP
stateSDL_PRESSED or SDL_RELEASED
keysymContains key press information

Description

SDL_KeyboardEvent is a member of the SDL_Event union and is used when an event of type SDL_KEYDOWN or SDL_KEYUP is reported.

The type and state actually report the same information, they just use different values to do it! A keyboard event occurs when a key is released (type=SDK_KEYUP or state=SDL_RELEASED) and when a key is pressed (type=SDL_KEYDOWN or state=SDL_PRESSED). The information on what key was pressed or released is in the keysym structure.

Note: Repeating SDL_KEYDOWN events will occur if key repeat is enabled (see SDL_EnableKeyRepeat).


PrevHomeNext
SDL_ActiveEventUpSDL_MouseMotionEvent
\ No newline at end of file diff --git a/docs/html/sdlkeysym.html b/docs/html/sdlkeysym.html new file mode 100644 index 0000000..7a22f79 --- /dev/null +++ b/docs/html/sdlkeysym.html @@ -0,0 +1,355 @@ +SDL_keysym
SDL Library Documentation
PrevNext

SDL_keysym

Name

SDL_keysym -- Keysym structure

Structure Definition

typedef struct{
+  Uint8 scancode;
+  SDLKey sym;
+  SDLMod mod;
+  Uint16 unicode;
+} SDL_keysym;

Structure Data

scancodeHardware specific scancode
symSDL virtual keysym
modCurrent key modifiers
unicodeTranslated character

Description

The SDL_keysym structure is used by reporting key presses and releases since it is a part of the SDL_KeyboardEvent.

The scancode field should generally be left alone, it is the hardware dependent scancode returned by the keyboard. The sym field is extremely useful. It is the SDL-defined value of the key (see SDL Key Syms. This field is very useful when you are checking for certain key presses, like so: +

.
+.
+while(SDL_PollEvent(&event)){
+  switch(event.type){
+    case SDL_KEYDOWN:
+      if(event.key.keysym.sym==SDLK_LEFT)
+        move_left();
+      break;
+    .
+    .
+    .
+  }
+}
+.
+.
+mod stores the current state of the keyboard modifiers as explained in SDL_GetModState. The unicode is only used when UNICODE translation is enabled with SDL_EnableUNICODE. If unicode is non-zero then this a the UNICODE character corresponding to the keypress. If the high 9 bits of the character are 0, then this maps to the equivalent ASCII character: +
char ch;
+if ( (keysym.unicode & 0xFF80) == 0 ) {
+  ch = keysym.unicode & 0x7F;
+}
+else {
+  printf("An International Character.\n");
+}
+UNICODE translation does have a slight overhead so don't enable it unless its needed.

See Also

SDLKey


PrevHomeNext
SDL_QuitEventUpSDLKey
\ No newline at end of file diff --git a/docs/html/sdlkillthread.html b/docs/html/sdlkillthread.html new file mode 100644 index 0000000..2ce7b9b --- /dev/null +++ b/docs/html/sdlkillthread.html @@ -0,0 +1,223 @@ +SDL_KillThread
SDL Library Documentation
PrevNext

SDL_KillThread

Name

SDL_KillThread -- Gracelessly terminates the thread.

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

void SDL_KillThread(SDL_Thread *thread);

Description

SDL_KillThread gracelessly terminates the thread +associated with thread. If possible, you should +use some other form of IPC to signal the thread to quit.


PrevHomeNext
SDL_WaitThreadUpSDL_CreateMutex
\ No newline at end of file diff --git a/docs/html/sdllistmodes.html b/docs/html/sdllistmodes.html new file mode 100644 index 0000000..ee7bc0e --- /dev/null +++ b/docs/html/sdllistmodes.html @@ -0,0 +1,310 @@ +SDL_ListModes
SDL Library Documentation
PrevNext

SDL_ListModes

Name

SDL_ListModes -- Returns a pointer to an array of available screen dimensions for +the given format and video flags

Synopsis

#include "SDL.h"

SDL_Rect **SDL_ListModes(SDL_PixelFormat *format, Uint32 flags);

Description

Return a pointer to an array of available screen dimensions for the given +format and video flags, sorted largest to smallest. Returns +NULL if there are no dimensions available for a particular +format, or -1 if any dimension is okay for +the given format.

If format is NULL, the mode list +will be for the format returned by SDL_GetVideoInfo()->vfmt. The flag parameter is an OR'd combination of surface flags. The flags are the same as those used SDL_SetVideoMode and they play a strong role in deciding what modes are valid. For instance, if you pass SDL_HWSURFACE as a flag only modes that support hardware video surfaces will be returned.

Example

SDL_Rect **modes;
+int i;
+.
+.
+.
+
+/* Get available fullscreen/hardware modes */
+modes=SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE);
+
+/* Check is there are any modes available */
+if(modes == (SDL_Rect **)0){
+  printf("No modes available!\n");
+  exit(-1);
+}
+
+/* Check if our resolution is restricted */
+if(modes == (SDL_Rect **)-1){
+  printf("All resolutions available.\n");
+}
+else{
+  /* Print valid modes */
+  printf("Available Modes\n");
+  for(i=0;modes[i];++i)
+    printf("  %d x %d\n", modes[i]->w, modes[i]->h);
+}
+.
+.

PrevHomeNext
SDL_VideoDriverNameUpSDL_VideoModeOK
\ No newline at end of file diff --git a/docs/html/sdlloadbmp.html b/docs/html/sdlloadbmp.html new file mode 100644 index 0000000..41556e3 --- /dev/null +++ b/docs/html/sdlloadbmp.html @@ -0,0 +1,219 @@ +SDL_LoadBMP
SDL Library Documentation
PrevNext

SDL_LoadBMP

Name

SDL_LoadBMP -- Load a Windows BMP file into an SDL_Surface.

Synopsis

#include "SDL.h"

SDL_Surface *SDL_LoadBMP(const char *file);

Description

Loads a surface from a named Windows BMP file.

Return Value

Returns the new surface, or NULL +if there was an error.

See Also

SDL_SaveBMP


PrevHomeNext
SDL_UnlockSurfaceUpSDL_SaveBMP
\ No newline at end of file diff --git a/docs/html/sdlloadwav.html b/docs/html/sdlloadwav.html new file mode 100644 index 0000000..8abb73e --- /dev/null +++ b/docs/html/sdlloadwav.html @@ -0,0 +1,296 @@ +SDL_LoadWAV
SDL Library Documentation
PrevNext

SDL_LoadWAV

Name

SDL_LoadWAV -- Load a WAVE file

Synopsis

#include "SDL.h"

SDL_AudioSpec *SDL_LoadWAV(const char *file, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);

Description

SDL_LoadWAV +This function loads a WAVE file into memory.

If this function succeeds, it returns the given +SDL_AudioSpec, +filled with the audio data format of the wave data, and sets +audio_buf to a malloc'd +buffer containing the audio data, and sets audio_len +to the length of that audio buffer, in bytes. You need to free the audio +buffer with SDL_FreeWAV when you are +done with it.

This function returns NULL and sets the SDL +error message if the wave file cannot be opened, uses an unknown data format, +or is corrupt. Currently raw, MS-ADPCM and IMA-ADPCM WAVE files are supported.

Example

SDL_AudioSpec wav_spec;
+Uint32 wav_length;
+Uint8 *wav_buffer;
+
+/* Load the WAV */
+if( SDL_LoadWAV("test.wav", &wav_spec, &wav_buffer, &wav_length) == NULL ){
+  fprintf(stderr, "Could not open test.wav: %s\n", SDL_GetError());
+  exit(-1);
+}
+.
+.
+.
+/* Do stuff with the WAV */
+.
+.
+/* Free It */
+SDL_FreeWAV(wav_buffer);

PrevHomeNext
SDL_GetAudioStatusUpSDL_FreeWAV
\ No newline at end of file diff --git a/docs/html/sdllockaudio.html b/docs/html/sdllockaudio.html new file mode 100644 index 0000000..0e6fc29 --- /dev/null +++ b/docs/html/sdllockaudio.html @@ -0,0 +1,208 @@ +SDL_LockAudio
SDL Library Documentation
PrevNext

SDL_LockAudio

Name

SDL_LockAudio -- Lock out the callback function

Synopsis

#include "SDL.h"

void SDL_LockAudio(void);

Description

The lock manipulated by these functions protects the callback function. +During a LockAudio period, you can be guaranteed that the +callback function is not running. Do not call these from the callback +function or you will cause deadlock.


PrevHomeNext
SDL_MixAudioUpSDL_UnlockAudio
\ No newline at end of file diff --git a/docs/html/sdllocksurface.html b/docs/html/sdllocksurface.html new file mode 100644 index 0000000..40c8959 --- /dev/null +++ b/docs/html/sdllocksurface.html @@ -0,0 +1,306 @@ +SDL_LockSurface
SDL Library Documentation
PrevNext

SDL_LockSurface

Name

SDL_LockSurface -- Lock a surface for directly access.

Synopsis

#include "SDL.h"

int SDL_LockSurface(SDL_Surface *surface);

Description

SDL_LockSurface sets up a surface for directly +accessing the pixels. Between calls to SDL_LockSurface +and SDL_UnlockSurface, you can write to and read from +surface->pixels, using the pixel format stored in +surface->format. Once you are done accessing the +surface, you should use SDL_UnlockSurface to release it.

Not all surfaces require locking. +If SDL_MUSTLOCK(surface) +evaluates to 0, then you can read and write to the +surface at any time, and the pixel format of the surface will not change.

No operating system or library calls should be made between lock/unlock +pairs, as critical system locks may be held during this time.

It should be noted, that since SDL 1.1.8 surface locks are recursive. This means that you can lock a surface multiple times, but each lock must have a match unlock. +

    .
+    .
+    SDL_LockSurface( surface );
+    .
+    /* Surface is locked */
+    /* Direct pixel access on surface here */
+    .
+    SDL_LockSurface( surface );
+    .
+    /* More direct pixel access on surface */
+    .
+    SDL_UnlockSurface( surface );
+    /* Surface is still locked */
+    /* Note: Is versions < 1.1.8, the surface would have been */
+    /* no longer locked at this stage                         */
+    .
+    SDL_UnlockSurface( surface );
+    /* Surface is now unlocked */
+    .
+    .

Return Value

SDL_LockSurface returns 0, +or -1 if the surface couldn't be locked.


PrevHomeNext
SDL_FreeSurfaceUpSDL_UnlockSurface
\ No newline at end of file diff --git a/docs/html/sdllockyuvoverlay.html b/docs/html/sdllockyuvoverlay.html new file mode 100644 index 0000000..74e6ce6 --- /dev/null +++ b/docs/html/sdllockyuvoverlay.html @@ -0,0 +1,252 @@ +SDL_LockYUVOverlay
SDL Library Documentation
PrevNext

SDL_LockYUVOverlay

Name

SDL_LockYUVOverlay -- Lock an overlay

Synopsis

#include "SDL.h"

int SDL_LockYUVOverlay(SDL_Overlay *overlay);

Description

Much the same as SDL_LockSurface, SDL_LockYUVOverlay locks the overlay for direct access to pixel data.

Return Value

Returns 0 on success, or -1 on an error.


PrevHomeNext
SDL_CreateYUVOverlayUpSDL_UnlockYUVOverlay
\ No newline at end of file diff --git a/docs/html/sdlmaprgb.html b/docs/html/sdlmaprgb.html new file mode 100644 index 0000000..5086d0c --- /dev/null +++ b/docs/html/sdlmaprgb.html @@ -0,0 +1,254 @@ +SDL_MapRGB
SDL Library Documentation
PrevNext

SDL_MapRGB

Name

SDL_MapRGB -- Map a RGB color value to a pixel format.

Synopsis

#include "SDL.h"

Uint32 SDL_MapRGB(SDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b);

Description

Maps the RGB color value to the specified pixel format and returns the +pixel value as a 32-bit int.

If the format has a palette (8-bit) the index of the closest matching +color in the palette will be returned.

If the specified pixel format has an alpha component it will be returned +as all 1 bits (fully opaque).

Return Value

A pixel value best approximating the given RGB color value for a given +pixel format. If the pixel format bpp (color depth) is less than 32-bpp +then the unused upper bits of the return value can safely be ignored +(e.g., with a 16-bpp format the return value can be assigned to a +Uint16, and similarly a Uint8 for an 8-bpp +format).


PrevHomeNext
SDL_SetGammaRampUpSDL_MapRGBA
\ No newline at end of file diff --git a/docs/html/sdlmaprgba.html b/docs/html/sdlmaprgba.html new file mode 100644 index 0000000..e6bff27 --- /dev/null +++ b/docs/html/sdlmaprgba.html @@ -0,0 +1,242 @@ +SDL_MapRGBA
SDL Library Documentation
PrevNext

SDL_MapRGBA

Name

SDL_MapRGBA -- Map a RGBA color value to a pixel format.

Synopsis

#include "SDL.h"

Uint32 SDL_MapRGBA(SDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b, Uint8 a);

Description

Maps the RGBA color value to the specified pixel format and returns the +pixel value as a 32-bit int.

If the format has a palette (8-bit) the index of the closest matching +color in the palette will be returned.

If the specified pixel format has no alpha component the alpha value +will be ignored (as it will be in formats with a palette).

Return Value

A pixel value best approximating the given RGBA color value for a given +pixel format. If the pixel format bpp (color depth) is less than 32-bpp +then the unused upper bits of the return value can safely be ignored +(e.g., with a 16-bpp format the return value can be assigned to a +Uint16, and similarly a Uint8 for an 8-bpp +format).


PrevHomeNext
SDL_MapRGBUpSDL_GetRGB
\ No newline at end of file diff --git a/docs/html/sdlmixaudio.html b/docs/html/sdlmixaudio.html new file mode 100644 index 0000000..6cbf0f0 --- /dev/null +++ b/docs/html/sdlmixaudio.html @@ -0,0 +1,237 @@ +SDL_MixAudio
SDL Library Documentation
PrevNext

SDL_MixAudio

Name

SDL_MixAudio -- Mix audio data

Synopsis

#include "SDL.h"

void SDL_MixAudio(Uint8 *dst, Uint8 *src, Uint32 len, int volume);

Description

This function takes two audio buffers of len bytes each +of the playing audio format and mixes them, performing addition, volume +adjustment, and overflow clipping. The volume ranges +from 0 to SDL_MIX_MAXVOLUME and should be set to the maximum +value for full audio volume. Note this does not change hardware volume. This is +provided for convenience -- you can mix your own audio data.

Note: Do not use this function for mixing together more than two streams of sample +data. The output from repeated application of this function may be distorted +by clipping, because there is no accumulator with greater range than the +input (not to mention this being an inefficient way of doing it). +Use mixing functions from SDL_mixer, OpenAL, or write your own mixer instead.


PrevHomeNext
SDL_ConvertAudioUpSDL_LockAudio
\ No newline at end of file diff --git a/docs/html/sdlmousebuttonevent.html b/docs/html/sdlmousebuttonevent.html new file mode 100644 index 0000000..b0b40df --- /dev/null +++ b/docs/html/sdlmousebuttonevent.html @@ -0,0 +1,346 @@ +SDL_MouseButtonEvent
SDL Library Documentation
PrevNext

SDL_MouseButtonEvent

Name

SDL_MouseButtonEvent -- Mouse button event structure

Structure Definition

typedef struct{
+  Uint8 type;
+  Uint8 button;
+  Uint8 state;
+  Uint16 x, y;
+} SDL_MouseButtonEvent;

Structure Data

typeSDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP
buttonThe mouse button index (SDL_BUTTON_LEFT, SDL_BUTTON_MIDDLE, SDL_BUTTON_RIGHT)
stateSDL_PRESSED or SDL_RELEASED
x, yThe X/Y coordinates of the mouse at press/release time

Description

SDL_MouseButtonEvent is a member of the SDL_Event union and is used when an event of type SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP is reported.

When a mouse button press or release is detected then number of the button pressed (from 1 to 255, with 1 usually being the left button and 2 the right) is placed into button, the position of the mouse when this event occured is stored in the x and the y fields. Like SDL_KeyboardEvent, information on whether the event was a press or a release event is stored in both the type and state fields, but this should be obvious.


PrevHomeNext
SDL_MouseMotionEventUpSDL_JoyAxisEvent
\ No newline at end of file diff --git a/docs/html/sdlmousemotionevent.html b/docs/html/sdlmousemotionevent.html new file mode 100644 index 0000000..3cc7cb5 --- /dev/null +++ b/docs/html/sdlmousemotionevent.html @@ -0,0 +1,365 @@ +SDL_MouseMotionEvent
SDL Library Documentation
PrevNext

SDL_MouseMotionEvent

Name

SDL_MouseMotionEvent -- Mouse motion event structure

Structure Definition

typedef struct{
+  Uint8 type;
+  Uint8 state;
+  Uint16 x, y;
+  Sint16 xrel, yrel;
+} SDL_MouseMotionEvent;

Structure Data

typeSDL_MOUSEMOTION
stateThe current button state
x, yThe X/Y coordinates of the mouse
xrel, yrelRelative motion in the X/Y direction

Description

SDL_MouseMotionEvent is a member of the SDL_Event union and is used when an event of type SDL_MOUSEMOTION is reported.

Simply put, a SDL_MOUSEMOTION type event occurs when a user moves the mouse within the application window or when SDL_WarpMouse is called. Both the absolute (x and y) and relative (xrel and yrel) coordinates are reported along with the current button states (state). The button state can be interpreted using the SDL_BUTTON macro (see SDL_GetMouseState).

If the cursor is hidden (SDL_ShowCursor(0)) and the input is grabbed (SDL_WM_GrabInput(SDL_GRAB_ON)), then the mouse will give relative motion events even when the cursor reaches the edge fo the screen. This is currently only implemented on Windows and Linux/Unix-a-likes.


PrevHomeNext
SDL_KeyboardEventUpSDL_MouseButtonEvent
\ No newline at end of file diff --git a/docs/html/sdlmutexp.html b/docs/html/sdlmutexp.html new file mode 100644 index 0000000..fc32ca5 --- /dev/null +++ b/docs/html/sdlmutexp.html @@ -0,0 +1,241 @@ +SDL_mutexP
SDL Library Documentation
PrevNext

SDL_mutexP

Name

SDL_mutexP -- Lock a mutex

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

int SDL_mutexP(SDL_mutex *mutex);

Description

Locks the mutex, which was previously created with SDL_CreateMutex. If the mutex is already locked then SDL_mutexP will not return until it is unlocked. Returns 0 on success, or -1 on an error.

SDL also defines a macro #define SDL_LockMutex(m) SDL_mutexP(m).


PrevHomeNext
SDL_DestroyMutexUpSDL_mutexV
\ No newline at end of file diff --git a/docs/html/sdlmutexv.html b/docs/html/sdlmutexv.html new file mode 100644 index 0000000..06a68bd --- /dev/null +++ b/docs/html/sdlmutexv.html @@ -0,0 +1,235 @@ +SDL_mutexV
SDL Library Documentation
PrevNext

SDL_mutexV

Name

SDL_mutexV -- Unlock a mutex

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

int SDL_mutexV(SDL_mutex *mutex);

Description

Unlocks the mutex, which was previously created with SDL_CreateMutex. Returns 0 on success, or -1 on an error.

SDL also defines a macro #define SDL_UnlockMutex(m) SDL_mutexV(m).


PrevHomeNext
SDL_mutexPUpSDL_CreateSemaphore
\ No newline at end of file diff --git a/docs/html/sdlnumjoysticks.html b/docs/html/sdlnumjoysticks.html new file mode 100644 index 0000000..68e3e3a --- /dev/null +++ b/docs/html/sdlnumjoysticks.html @@ -0,0 +1,222 @@ +SDL_NumJoysticks
SDL Library Documentation
PrevNext

SDL_NumJoysticks

Name

SDL_NumJoysticks -- Count available joysticks.

Synopsis

#include "SDL.h"

int SDL_NumJoysticks(void);

Description

Counts the number of joysticks attached to the system.

Return Value

Returns the number of attached joysticks


PrevHomeNext
JoystickUpSDL_JoystickName
\ No newline at end of file diff --git a/docs/html/sdlopenaudio.html b/docs/html/sdlopenaudio.html new file mode 100644 index 0000000..bcfed54 --- /dev/null +++ b/docs/html/sdlopenaudio.html @@ -0,0 +1,578 @@ +SDL_OpenAudio
SDL Library Documentation
PrevNext

SDL_OpenAudio

Name

SDL_OpenAudio -- Opens the audio device with the desired parameters.

Synopsis

#include "SDL.h"

int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained);

Description

This function opens the audio device with the desired parameters, and +returns 0 if successful, placing the actual hardware parameters in the +structure pointed to by obtained. If obtained is NULL, the audio +data passed to the callback function will be guaranteed to be in the +requested format, and will be automatically converted to the hardware +audio format if necessary. This function returns -1 if it failed +to open the audio device, or couldn't set up the audio thread.

To open the audio device a desired SDL_AudioSpec must be created. +

SDL_AudioSpec *desired;
+.
+.
+desired = malloc(sizeof(SDL_AudioSpec));
+You must then fill this structure with your desired audio specifications.

desired->freq

The desired audio frequency in samples-per-second.

desired->format

The desired audio format (see SDL_AudioSpec)

desired->samples

The desired size of the audio buffer in samples. This number should be a power of two, and may be adjusted by the audio driver to a value more suitable for the hardware. Good values seem to range between 512 and 8192 inclusive, depending on the application and CPU speed. Smaller values yield faster response time, but can lead to underflow if the application is doing heavy processing and cannot fill the audio buffer in time. A stereo sample consists of both right and left channels in LR ordering. Note that the number of samples is directly related to time by the following formula: ms = (samples*1000)/freq

desired->callback

This should be set to a function that will be called when the audio device is ready for more data. It is passed a pointer to the audio buffer, and the length in bytes of the audio buffer. This function usually runs in a separate thread, and so you should protect data structures that it accesses by calling SDL_LockAudio and SDL_UnlockAudio in your code. The callback prototype is: +

void callback(void *userdata, Uint8 *stream, int len);
+userdata is the pointer stored in userdata field of the SDL_AudioSpec. stream is a pointer to the audio buffer you want to fill with information and len is the length of the audio buffer in bytes.

desired->userdata

This pointer is passed as the first parameter to the callback function.

SDL_OpenAudio reads these fields from the desired SDL_AudioSpec structure pass to the function and attempts to find an audio configuration matching your desired. As mentioned above, if the obtained parameter is NULL then SDL with convert from your desired audio settings to the hardware settings as it plays.

If obtained is NULL then the desired SDL_AudioSpec is your working specification, otherwise the obtained SDL_AudioSpec becomes the working specification and the desirec specification can be deleted. The data in the working specification is used when building SDL_AudioCVT's for converting loaded data to the hardware format.

SDL_OpenAudio calculates the size and silence fields for both the desired and obtained specifications. The size field stores the total size of the audio buffer in bytes, while the silence stores the value used to represent silence in the audio buffer

The audio device starts out playing silence when it's opened, and should be enabled for playing by calling SDL_PauseAudio(0) when you are ready for your audio callback function to be called. Since the audio driver may modify the requested size of the audio buffer, you should allocate any local mixing buffers after you open the audio device.

Examples

/* Prototype of our callback function */
+void my_audio_callback(void *userdata, Uint8 *stream, int len);
+
+/* Open the audio device */
+SDL_AudioSpec *desired, *obtained;
+SDL_AudioSpec *hardware_spec;
+
+/* Allocate a desired SDL_AudioSpec */
+desired = malloc(sizeof(SDL_AudioSpec));
+
+/* Allocate space for the obtained SDL_AudioSpec */
+obtained = malloc(sizeof(SDL_AudioSpec));
+
+/* 22050Hz - FM Radio quality */
+desired->freq=22050;
+
+/* 16-bit signed audio */
+desired->format=AUDIO_S16LSB;
+
+/* Mono */
+desired->channels=0;
+
+/* Large audio buffer reduces risk of dropouts but increases response time */
+desired->samples=8192;
+
+/* Our callback function */
+desired->callback=my_audio_callback;
+
+desired->userdata=NULL;
+
+/* Open the audio device */
+if ( SDL_OpenAudio(desired, obtained) < 0 ){
+  fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
+  exit(-1);
+}
+/* desired spec is no longer needed */
+free(desired);
+hardware_spec=obtained;
+.
+.
+/* Prepare callback for playing */
+.
+.
+.
+/* Start playing */
+SDL_PauseAudio(0);

PrevHomeNext
SDL_AudioSpecUpSDL_PauseAudio
\ No newline at end of file diff --git a/docs/html/sdloverlay.html b/docs/html/sdloverlay.html new file mode 100644 index 0000000..422919e --- /dev/null +++ b/docs/html/sdloverlay.html @@ -0,0 +1,362 @@ +SDL_Overlay
SDL Library Documentation
PrevNext

SDL_Overlay

Name

SDL_Overlay -- YUV video overlay

Structure Definition

typedef struct{
+  Uint32 format;
+  int w, h;
+  int planes;
+  Uint16 *pitches;
+  Uint8 **pixels;
+  Uint32 hw_overlay:1;
+} SDL_Overlay;

Structure Data

formatOverlay format (see below)
w, hWidth and height of overlay
planesNumber of planes in the overlay. Usually either 1 or 3
pitchesAn array of pitches, one for each plane. Pitch is the length of a row in bytes.
pixelsAn array of pointers to teh data of each plane. The overlay should be locked before these pointers are used.
hw_overlayThis will be set to 1 if the overlay is hardware accelerated.

Description

A SDL_Overlay is similar to a SDL_Surface except it stores a YUV overlay. All the fields are read only, except for pixels which should be locked before use. The format field stores the format of the overlay which is one of the following: +

#define SDL_YV12_OVERLAY  0x32315659  /* Planar mode: Y + V + U */
+#define SDL_IYUV_OVERLAY  0x56555949  /* Planar mode: Y + U + V */
+#define SDL_YUY2_OVERLAY  0x32595559  /* Packed mode: Y0+U0+Y1+V0 */
+#define SDL_UYVY_OVERLAY  0x59565955  /* Packed mode: U0+Y0+V0+Y1 */
+#define SDL_YVYU_OVERLAY  0x55595659  /* Packed mode: Y0+V0+Y1+U0 */
+More information on YUV formats can be found at http://www.webartz.com/fourcc/indexyuv.htm.


PrevHomeNext
SDL_VideoInfoUpWindow Management
\ No newline at end of file diff --git a/docs/html/sdlpalette.html b/docs/html/sdlpalette.html new file mode 100644 index 0000000..6498ac4 --- /dev/null +++ b/docs/html/sdlpalette.html @@ -0,0 +1,301 @@ +SDL_Palette
SDL Library Documentation
PrevNext

SDL_Palette

Name

SDL_Palette -- Color palette for 8-bit pixel formats

Structure Definition

typedef struct{
+  int ncolors;
+  SDL_Color *colors;
+} SDL_Palette;

Structure Data

ncolorsNumber of colors used in this palette
colorsPointer to SDL_Color structures that make up the palette.

Description

Each pixel in an 8-bit surface is an index into the colors field of the SDL_Palette structure store in SDL_PixelFormat. A SDL_Palette should never need to be created manually. It is automatically created when SDL allocates a SDL_PixelFormat for a surface. The colors values of a SDL_Surfaces palette can be set with the SDL_SetColors.


PrevHomeNext
SDL_ColorUpSDL_PixelFormat
\ No newline at end of file diff --git a/docs/html/sdlpauseaudio.html b/docs/html/sdlpauseaudio.html new file mode 100644 index 0000000..39d5a0f --- /dev/null +++ b/docs/html/sdlpauseaudio.html @@ -0,0 +1,221 @@ +SDL_PauseAudio
SDL Library Documentation
PrevNext

SDL_PauseAudio

Name

SDL_PauseAudio -- Pauses and unpauses the audio callback processing

Synopsis

#include "SDL.h"

void SDL_PauseAudio(int pause_on);

Description

This function pauses and unpauses the audio callback processing. +It should be called with pause_on=0 after opening the audio +device to start playing sound. This is so you can safely initialize +data for your callback function after opening the audio device. +Silence will be written to the audio device during the pause.


PrevHomeNext
SDL_OpenAudioUpSDL_GetAudioStatus
\ No newline at end of file diff --git a/docs/html/sdlpeepevents.html b/docs/html/sdlpeepevents.html new file mode 100644 index 0000000..d5a0ff6 --- /dev/null +++ b/docs/html/sdlpeepevents.html @@ -0,0 +1,321 @@ +SDL_PeepEvents
SDL Library Documentation
PrevNext

SDL_PeepEvents

Name

SDL_PeepEvents -- Checks the event queue for messages and optionally returns them.

Synopsis

#include "SDL.h"

int SDL_PeepEvents(SDL_Event *events, int numevents, SDL_eventaction action, Uint32 mask);

Description

Checks the event queue for messages and optionally returns them.

If action is SDL_ADDEVENT, up to +numevents events will be added to the back of the event + queue.

If action is SDL_PEEKEVENT, up to +numevents events at the front of the event queue, +matching mask, +will be returned and will not be removed from the queue.

If action is SDL_GETEVENT, up to +numevents events at the front of the event queue, +matching mask, +will be returned and will be removed from the queue.

The mask parameter is an bitwise OR of +SDL_EVENTMASK(event_type), for all +event types you are interested in.

This function is thread-safe.

Return Value

This function returns the number of events actually stored, or +-1 if there was an error.


PrevHomeNext
SDL_PumpEventsUpSDL_PollEvent
\ No newline at end of file diff --git a/docs/html/sdlpixelformat.html b/docs/html/sdlpixelformat.html new file mode 100644 index 0000000..000ddc0 --- /dev/null +++ b/docs/html/sdlpixelformat.html @@ -0,0 +1,528 @@ +SDL_PixelFormat
SDL Library Documentation
PrevNext

SDL_PixelFormat

Name

SDL_PixelFormat -- Stores surface format information

Structure Definition

typedef struct SDL_PixelFormat {
+  SDL_Palette *palette;
+  Uint8  BitsPerPixel;
+  Uint8  BytesPerPixel;
+  Uint8  Rloss, Gloss, Bloss, Aloss;
+  Uint8  Rshift, Gshift, Bshift, Ashift;
+  Uint32 Rmask, Gmask, Bmask, Amask;
+  Uint32 colorkey;
+  Uint8  alpha;
+} SDL_PixelFormat;

Structure Data

palettePointer to the palette, or NULL if the BitsPerPixel>8
BitsPerPixelThe number of bits used to represent each pixel in a surface. Usually 8, 16, 24 or 32.
BytesPerPixelThe number of bytes used to represent each pixel in a surface. Usually one to four.
[RGBA]maskBinary mask used to retrieve individual color values
[RGBA]lossPrecision loss of each color component (2[RGBA]loss)
[RGBA]shiftBinary left shift of each color component in the pixel value
colorkeyPixel value of transparent pixels
alphaOverall surface alpha value

Description

A SDL_PixelFormat describes the format of the pixel data stored at the pixels field of a SDL_Surface. Every surface stores a SDL_PixelFormat in the format field.

If you wish to do pixel level modifications on a surface, then understanding how SDL stores its color information is essential.

8-bit pixel formats are the easiest to understand. Since its an 8-bit format, we have 8 BitsPerPixel and 1 BytesPerPixel. Since BytesPerPixel is 1, all pixels are represented by a Uint8 which contains an index into palette->colors. So, to determine the color of a pixel in a 8-bit surface: we read the color index from surface->pixels and we use that index to read the SDL_Color structure from surface->format->palette->colors. Like so: +

SDL_Surface *surface;
+SDL_PixelFormat *fmt;
+SDL_Color *color;
+Uint8 index;
+
+.
+.
+
+/* Create surface */
+.
+.
+fmt=surface->format;
+
+/* Check the bitdepth of the surface */
+if(fmt->BitsPerPixel!=8){
+  fprintf(stderr, "Not an 8-bit surface.\n");
+  return(-1);
+}
+
+/* Lock the surface */
+SDL_LockSurface(surface);
+
+/* Get the topleft pixel */
+index=*(Uint8 *)surface->pixels;
+color=fmt->palette->colors[index];
+
+/* Unlock the surface */
+SDL_UnlockSurface(surface);
+printf("Pixel Color-> Red: %d, Green: %d, Blue: %d. Index: %d\n",
+          color->r, color->g, color->b, index);
+.
+.

Pixel formats above 8-bit are an entirely different experience. They are +considered to be "TrueColor" formats and the color information is stored in the +pixels themselves, not in a palette. The mask, shift and loss fields tell us +how the color information is encoded. The mask fields allow us to isolate each +color component, the shift fields tell us the number of bits to the right of +each component in the pixel value and the loss fields tell us the number of +bits lost from each component when packing 8-bit color component in a pixel. +

/* Extracting color components from a 32-bit color value */
+SDL_PixelFormat *fmt;
+SDL_Surface *surface;
+Uint32 temp, pixel;
+Uint8 red, green, blue, alpha;
+.
+.
+.
+fmt=surface->format;
+SDL_LockSurface(surface);
+pixel=*((Uint32*)surface->pixels);
+SDL_UnlockSurface(surface);
+
+/* Get Red component */
+temp=pixel&fmt->Rmask; /* Isolate red component */
+temp=temp>>fmt->Rshift;/* Shift it down to 8-bit */
+temp=temp<<fmt->Rloss; /* Expand to a full 8-bit number */
+red=(Uint8)temp;
+
+/* Get Green component */
+temp=pixel&fmt->Gmask; /* Isolate green component */
+temp=temp>>fmt->Gshift;/* Shift it down to 8-bit */
+temp=temp<<fmt->Gloss; /* Expand to a full 8-bit number */
+green=(Uint8)temp;
+
+/* Get Blue component */
+temp=pixel&fmt->Bmask; /* Isolate blue component */
+temp=temp>>fmt->Bshift;/* Shift it down to 8-bit */
+temp=temp<<fmt->Bloss; /* Expand to a full 8-bit number */
+blue=(Uint8)temp;
+
+/* Get Alpha component */
+temp=pixel&fmt->Amask; /* Isolate alpha component */
+temp=temp>>fmt->Ashift;/* Shift it down to 8-bit */
+temp=temp<<fmt->Aloss; /* Expand to a full 8-bit number */
+alpha=(Uint8)temp;
+
+printf("Pixel Color -> R: %d,  G: %d,  B: %d,  A: %d\n", red, green, blue, alpha);
+.
+.
+.


PrevHomeNext
SDL_PaletteUpSDL_Surface
diff --git a/docs/html/sdlpollevent.html b/docs/html/sdlpollevent.html new file mode 100644 index 0000000..f97c22d --- /dev/null +++ b/docs/html/sdlpollevent.html @@ -0,0 +1,269 @@ +SDL_PollEvent
SDL Library Documentation
PrevNext

SDL_PollEvent

Name

SDL_PollEvent -- Polls for currently pending events.

Synopsis

#include "SDL.h"

int SDL_PollEvent(SDL_Event *event);

Description

Polls for currently pending events, and returns 1 +if there are any pending events, or 0 if there +are none available.

If event is not NULL, the next +event is removed from the queue and stored in that area.

Examples

SDL_Event event; /* Event structure */
+
+.
+.
+.
+/* Check for events */
+while(SDL_PollEvent(&event)){  /* Loop until there are no events left on the queue */
+  switch(event.type){  /* Process the appropiate event type */
+    case SDL_KEYDOWN:  /* Handle a KEYDOWN event */         
+      printf("Oh! Key press\n");
+      break;
+    case SDL_MOUSEMOTION:
+      .
+      .
+      .
+    default: /* Report an unhandled event */
+      printf("I don't know what this event is!\n");
+  }
+}


PrevHomeNext
SDL_PeepEventsUpSDL_WaitEvent
\ No newline at end of file diff --git a/docs/html/sdlpumpevents.html b/docs/html/sdlpumpevents.html new file mode 100644 index 0000000..a7e528f --- /dev/null +++ b/docs/html/sdlpumpevents.html @@ -0,0 +1,244 @@ +SDL_PumpEvents
SDL Library Documentation
PrevNext

SDL_PumpEvents

Name

SDL_PumpEvents -- Pumps the event loop, gathering events from the input devices.

Synopsis

#include "SDL.h"

void SDL_PumpEvents(void);

Description

Pumps the event loop, gathering events from the input devices.

SDL_PumpEvents gathers all the pending input information from devices and places it on the event queue. Without calls to SDL_PumpEvents no events would ever be placed on the queue. Often calls the need for SDL_PumpEvents is hidden from the user since SDL_PollEvent and SDL_WaitEvent implicitly call SDL_PumpEvents. However, if you are not polling or waiting for events (e.g. you are filtering them), then you must call SDL_PumpEvents to force an event queue update.

Note: You can only call this function in the thread that set the video mode.


PrevHomeNext
Event Functions.UpSDL_PeepEvents
\ No newline at end of file diff --git a/docs/html/sdlpushevent.html b/docs/html/sdlpushevent.html new file mode 100644 index 0000000..6905385 --- /dev/null +++ b/docs/html/sdlpushevent.html @@ -0,0 +1,266 @@ +SDL_PushEvent
SDL Library Documentation
PrevNext

SDL_PushEvent

Name

SDL_PushEvent -- Pushes an event onto the event queue

Synopsis

#include "SDL.h"

int SDL_PushEvent(SDL_Event *event);

Description

The event queue can actually be used as a two way communication channel. Not only can events be read from the queue, but the user can also push their own events onto it. event is a pointer to the event structure you wish to push onto the queue.

Note: Pushing device input events onto the queue doesn't modify the state of the device within SDL.

Return Value

Returns 0 on success or -1 if the event couldn't be pushed.

Examples

See SDL_Event.


PrevHomeNext
SDL_WaitEventUpSDL_SetEventFilter
\ No newline at end of file diff --git a/docs/html/sdlquit.html b/docs/html/sdlquit.html new file mode 100644 index 0000000..1f31c82 --- /dev/null +++ b/docs/html/sdlquit.html @@ -0,0 +1,244 @@ +SDL_Quit
SDL Library Documentation
PrevNext

SDL_Quit

Name

SDL_Quit -- Shut down SDL

Synopsis

#include "SDL.h"

void SDL_Quit(void);

Description

SDL_Quit shuts down all SDL subsystems and frees the resources allocated to them. This should always be called before you exit. For the sake of simplicity you can set SDL_Quit as your atexit call, like: +

SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO);
+atexit(SDL_Quit);
+.
+.

Note: While using atexit maybe be fine for small programs, more advanced users should shut down SDL in their own cleanup code. Plus, using atexit in a library is a sure way to crash dynamically loaded code


PrevHomeNext
SDL_QuitSubSystemUpSDL_WasInit
\ No newline at end of file diff --git a/docs/html/sdlquitevent.html b/docs/html/sdlquitevent.html new file mode 100644 index 0000000..d575f38 --- /dev/null +++ b/docs/html/sdlquitevent.html @@ -0,0 +1,263 @@ +SDL_QuitEvent
SDL Library Documentation
PrevNext

SDL_QuitEvent

Name

SDL_QuitEvent -- Quit requested event

Structure Definition

typedef struct{
+  Uint8 type
+} SDL_QuitEvent;

Structure Data

typeSDL_QUIT

Description

SDL_QuitEvent is a member of the SDL_Event union and is used whan an event of type SDL_QUIT is reported.

As can be seen, the SDL_QuitEvent structure serves no useful purpose. The event itself, on the other hand, is very important. If you filter out or ignore a quit event then it is impossible for the user to close the window. On the other hand, if you do accept a quit event then the application window will be closed, and screen updates will still report success event though the application will no longer be visible.

Note: The macro SDL_QuitRequested will return non-zero if a quit event is pending


PrevHomeNext
SDL_UserEventUpSDL_keysym
\ No newline at end of file diff --git a/docs/html/sdlquitsubsystem.html b/docs/html/sdlquitsubsystem.html new file mode 100644 index 0000000..877e3ce --- /dev/null +++ b/docs/html/sdlquitsubsystem.html @@ -0,0 +1,248 @@ +SDL_QuitSubSystem
SDL Library Documentation
PrevNext

SDL_QuitSubSystem

Name

SDL_QuitSubSystem -- Shut down a subsystem

Synopsis

#include "SDL.h"

void SDL_QuitSubSystem(Uint32 flags);

Description

SDL_QuitSubSystem allows you to shut down a subsystem that has been previously initialized by SDL_Init or SDL_InitSubSystem. The flags tells SDL_QuitSubSystem which subsystems to shut down, it uses the same values that are passed to SDL_Init.


PrevHomeNext
SDL_InitSubSystemUpSDL_Quit
\ No newline at end of file diff --git a/docs/html/sdlrect.html b/docs/html/sdlrect.html new file mode 100644 index 0000000..ba4a80b --- /dev/null +++ b/docs/html/sdlrect.html @@ -0,0 +1,258 @@ +SDL_Rect
SDL Library Documentation
PrevNext

SDL_Rect

Name

SDL_Rect -- Defines a rectangular area

Structure Definition

typedef struct{
+  Sint16 x, y;
+  Uint16 w, h;
+} SDL_Rect;

Structure Data

x, yPosition of the upper-left corner of the rectangle
w, hThe width and height of the rectangle

Description

A SDL_Rect defines a rectangular area of pixels. It is used by SDL_BlitSurface to define blitting regions and by several other video functions.


PrevHomeNext
SDL_GLattrUpSDL_Color
\ No newline at end of file diff --git a/docs/html/sdlremovetimer.html b/docs/html/sdlremovetimer.html new file mode 100644 index 0000000..26a3d11 --- /dev/null +++ b/docs/html/sdlremovetimer.html @@ -0,0 +1,236 @@ +SDL_RemoveTimer
SDL Library Documentation
PrevNext

SDL_RemoveTimer

Name

SDL_RemoveTimer -- Remove a timer which was added with +SDL_AddTimer.

Synopsis

#include "SDL.h"

SDL_bool SDL_RemoveTimer(SDL_TimerID id);

Description

Removes a timer callback previously added with +SDL_AddTimer.

Return Value

Returns a boolean value indicating success.

Examples

SDL_RemoveTimer(my_timer_id);

See Also

SDL_AddTimer


PrevHomeNext
SDL_AddTimerUpSDL_SetTimer
\ No newline at end of file diff --git a/docs/html/sdlresizeevent.html b/docs/html/sdlresizeevent.html new file mode 100644 index 0000000..1d446a5 --- /dev/null +++ b/docs/html/sdlresizeevent.html @@ -0,0 +1,307 @@ +SDL_ResizeEvent
SDL Library Documentation
PrevNext

SDL_ResizeEvent

Name

SDL_ResizeEvent -- Window resize event structure

Structure Definition

typedef struct{
+  Uint8 type;
+  int w, h;
+} SDL_ResizeEvent;

Structure Data

typeSDL_VIDEORESIZE
w, hNew width and height of the window

Description

SDL_ResizeEvent is a member of the SDL_Event union and is used when an event of type SDL_VIDEORESIZE is reported.

When SDL_RESIZABLE is passed as a flag to SDL_SetVideoMode the user is allowed to resize the applications window. When the window is resized an SDL_VIDEORESIZE is report, with the new window width and height values stored in w and h, respectively. When an SDL_VIDEORESIZE is recieved the window should be resized to the new dimensions using SDL_SetVideoMode.


PrevHomeNext
SDL_JoyBallEventUpSDL_ExposeEvent
\ No newline at end of file diff --git a/docs/html/sdlsavebmp.html b/docs/html/sdlsavebmp.html new file mode 100644 index 0000000..4c318ed --- /dev/null +++ b/docs/html/sdlsavebmp.html @@ -0,0 +1,236 @@ +SDL_SaveBMP
SDL Library Documentation
PrevNext

SDL_SaveBMP

Name

SDL_SaveBMP -- Save an SDL_Surface as a Windows BMP file.

Synopsis

#include "SDL.h"

int SDL_SaveBMP(SDL_Surface *surface, const char *file);

Description

Saves the SDL_Surface surface as a Windows BMP file named file.

Return Value

Returns 0 if successful or +-1 +if there was an error.

See Also

SDL_LoadBMP


PrevHomeNext
SDL_LoadBMPUpSDL_SetColorKey
\ No newline at end of file diff --git a/docs/html/sdlsempost.html b/docs/html/sdlsempost.html new file mode 100644 index 0000000..18fb01a --- /dev/null +++ b/docs/html/sdlsempost.html @@ -0,0 +1,299 @@ +SDL_SemPost
SDL Library Documentation
PrevNext

SDL_SemPost

Name

SDL_SemPost -- Unlock a semaphore.

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

int SDL_SemPost(SDL_sem *sem);

Description

SDL_SemPost unlocks the semaphore pointed to by +sem and atomically increments the semaphores value. +Threads that were blocking on the semaphore may be scheduled after this call +succeeds.

SDL_SemPost should be called after a semaphore is locked by a successful call to +SDL_SemWait, +SDL_SemTryWait or +SDL_SemWaitTimeout.

Return Value

Returns 0 if successful or +-1 if there was an error (leaving the semaphore unchanged).

Examples

SDL_SemPost(my_sem);


PrevHomeNext
SDL_SemWaitTimeoutUpSDL_SemValue
\ No newline at end of file diff --git a/docs/html/sdlsemtrywait.html b/docs/html/sdlsemtrywait.html new file mode 100644 index 0000000..86f47a1 --- /dev/null +++ b/docs/html/sdlsemtrywait.html @@ -0,0 +1,319 @@ +SDL_SemTryWait
SDL Library Documentation
PrevNext

SDL_SemTryWait

Name

SDL_SemTryWait -- Attempt to lock a semaphore but don't suspend the thread.

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

int SDL_SemTryWait(SDL_sem *sem);

Description

SDL_SemTryWait is a non-blocking varient of +SDL_SemWait. If the value of the semaphore +pointed to by sem is positive it will atomically +decrement the semaphore value and return 0, otherwise it will return +SDL_MUTEX_TIMEDOUT instead of suspending the thread.

After SDL_SemTryWait is successful, the semaphore +can be released and its count atomically incremented by a successful call to +SDL_SemPost.

Return Value

Returns 0 if the semaphore was successfully locked or +either SDL_MUTEX_TIMEDOUT or -1 +if the thread would have suspended or there was an error, respectivly.

If the semaphore was not successfully locked, the semaphore will be unchanged.

Examples

res = SDL_SemTryWait(my_sem);
+
+if (res == SDL_MUTEX_TIMEDOUT) {
+        return TRY_AGAIN;
+}
+if (res == -1) {
+        return WAIT_ERROR;
+}
+
+...
+
+SDL_SemPost(my_sem);


PrevHomeNext
SDL_SemWaitUpSDL_SemWaitTimeout
\ No newline at end of file diff --git a/docs/html/sdlsemvalue.html b/docs/html/sdlsemvalue.html new file mode 100644 index 0000000..7867369 --- /dev/null +++ b/docs/html/sdlsemvalue.html @@ -0,0 +1,273 @@ +SDL_SemValue
SDL Library Documentation
PrevNext

SDL_SemValue

Name

SDL_SemValue -- Return the current value of a semaphore.

Synopsis

#include "SDL.h"
+#include "SDL/SDL_thread.h"

Uint32 SDL_SemValue(SDL_sem *sem);

Description

SDL_SemValue() returns the current semaphore value from +the semaphore pointed to by sem.

Return Value

Returns current value of the semaphore.

Examples

  sem_value = SDL_SemValue(my_sem);


PrevHomeNext
SDL_SemPostUpSDL_CreateCond
\ No newline at end of file diff --git a/docs/html/sdlsemwait.html b/docs/html/sdlsemwait.html new file mode 100644 index 0000000..5e98d55 --- /dev/null +++ b/docs/html/sdlsemwait.html @@ -0,0 +1,298 @@ +SDL_SemWait
SDL Library Documentation
PrevNext

SDL_SemWait

Name

SDL_SemWait -- Lock a semaphore and suspend the thread if the semaphore value is zero.

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

int SDL_SemWait(SDL_sem *sem);

Description

SDL_SemWait() suspends the calling thread until either +the semaphore pointed to by sem has a positive value, +the call is interrupted by a signal or error. If the call is successful it +will atomically decrement the semaphore value.

After SDL_SemWait() is successful, the semaphore +can be released and its count atomically incremented by a successful call to +SDL_SemPost.

Return Value

Returns 0 if successful or +-1 if there was an error (leaving the semaphore unchanged).

Examples

if (SDL_SemWait(my_sem) == -1) {
+        return WAIT_FAILED;
+}
+
+...
+
+SDL_SemPost(my_sem);


PrevHomeNext
SDL_DestroySemaphoreUpSDL_SemTryWait
\ No newline at end of file diff --git a/docs/html/sdlsemwaittimeout.html b/docs/html/sdlsemwaittimeout.html new file mode 100644 index 0000000..788f5b7 --- /dev/null +++ b/docs/html/sdlsemwaittimeout.html @@ -0,0 +1,322 @@ +SDL_SemWaitTimeout
SDL Library Documentation
PrevNext

SDL_SemWaitTimeout

Name

SDL_SemWaitTimeout -- Lock a semaphore, but only wait up to a specified maximum time.

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout);

Description

SDL_SemWaitTimeout() is a varient of +SDL_SemWait +with a maximum timeout value. +If the value of the semaphore pointed to by sem is +positive (greater than zero) it will atomically decrement the semaphore value +and return 0, otherwise it will wait up to timeout +milliseconds trying to lock the semaphore. This function is to be avoided if +possible since on some platforms it is implemented by polling the semaphore +every millisecond in a busy loop.

After SDL_SemWaitTimeout() is successful, the semaphore +can be released and its count atomically incremented by a successful call to +SDL_SemPost.

Return Value

Returns 0 if the semaphore was successfully locked or +either SDL_MUTEX_TIMEDOUT or -1 +if the timeout period was exceeded or there was an error, respectivly.

If the semaphore was not successfully locked, the semaphore will be unchanged.

Examples

res = SDL_SemWaitTimeout(my_sem, WAIT_TIMEOUT_MILLISEC);
+
+if (res == SDL_MUTEX_TIMEDOUT) {
+        return TRY_AGAIN;
+}
+if (res == -1) {
+        return WAIT_ERROR;
+}
+
+...
+
+SDL_SemPost(my_sem);


PrevHomeNext
SDL_SemTryWaitUpSDL_SemPost
\ No newline at end of file diff --git a/docs/html/sdlsetalpha.html b/docs/html/sdlsetalpha.html new file mode 100644 index 0000000..fc84498 --- /dev/null +++ b/docs/html/sdlsetalpha.html @@ -0,0 +1,500 @@ +SDL_SetAlpha
SDL Library Documentation
PrevNext

SDL_SetAlpha

Name

SDL_SetAlpha -- Adjust the alpha properties of a surface

Synopsis

#include "SDL.h"

int SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha);

Description

Note: This function and the semantics of SDL alpha blending have changed since version 1.1.4. Up until version 1.1.5, an alpha value of 0 was considered opaque and a value of 255 was considered transparent. This has now been inverted: 0 (SDL_ALPHA_TRANSPARENT) is now considered transparent and 255 (SDL_ALPHA_OPAQUE) is now considered opaque.

SDL_SetAlpha is used for setting the per-surface alpha +value and/or enabling and disabling alpha blending.

Thesurface parameter specifies which surface whose alpha +attributes you wish to adjust. flags is used to specify +whether alpha blending should be used (SDL_SRCALPHA) and +whether the surface should use RLE acceleration for blitting +(SDL_RLEACCEL). flags can be an OR'd +combination of these two options, one of these options or 0. If +SDL_SRCALPHA is not passed as a flag then all alpha +information is ignored when blitting the surface. The +alpha parameter is the per-surface alpha value; a +surface need not have an alpha channel to use per-surface alpha and blitting +can still be accelerated with SDL_RLEACCEL.

Note: The per-surface alpha value of 128 is considered a special case and +is optimised, so it's much faster than other per-surface values.

Alpha effects surface blitting in the following ways:

RGBA->RGB with SDL_SRCALPHA

The source is alpha-blended with the destination, using the alpha channel. SDL_SRCCOLORKEY and the per-surface alpha are ignored.

RGBA->RGB without SDL_SRCALPHA

The RGB data is copied from the source. The source alpha channel and the per-surface alpha value are ignored.

RGB->RGBA with SDL_SRCALPHA

The source is alpha-blended with the destination using the per-surface alpha +value. If SDL_SRCCOLORKEY is set, only the pixels not +matching the colorkey value are copied. The alpha channel of the copied pixels +is set to opaque.

RGB->RGBA without SDL_SRCALPHA

The RGB data is copied from the source and the alpha value of the copied pixels +is set to opaque. If SDL_SRCCOLORKEY is set, only the pixels +not matching the colorkey value are copied.

RGBA->RGBA with SDL_SRCALPHA

The source is alpha-blended with the destination using the source alpha +channel. The alpha channel in the destination surface is left untouched. +SDL_SRCCOLORKEY is ignored.

RGBA->RGBA without SDL_SRCALPHA

The RGBA data is copied to the destination surface. If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.

RGB->RGB with SDL_SRCALPHA

The source is alpha-blended with the destination using the per-surface alpha value. If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.

RGB->RGB without SDL_SRCALPHA

The RGB data is copied from the source. If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.

Note: Note that RGBA->RGBA blits (with SDL_SRCALPHA set) keep the alpha +of the destination surface. This means that you cannot compose two arbitrary +RGBA surfaces this way and get the result you would expect from "overlaying" +them; the destination alpha will work as a mask.

Also note that per-pixel and per-surface alpha cannot be combined; +the per-pixel alpha is always used if available

Return Value

This function returns 0, or +-1 if there was an error.


PrevHomeNext
SDL_SetColorKeyUpSDL_SetClipRect
\ No newline at end of file diff --git a/docs/html/sdlsetcliprect.html b/docs/html/sdlsetcliprect.html new file mode 100644 index 0000000..03898d5 --- /dev/null +++ b/docs/html/sdlsetcliprect.html @@ -0,0 +1,241 @@ +SDL_SetClipRect
SDL Library Documentation
PrevNext

SDL_SetClipRect

Name

SDL_SetClipRect -- Sets the clipping rectangle for a surface.

Synopsis

#include "SDL.h"

void SDL_SetClipRect(SDL_Surface *surface, SDL_Rect *rect);

Description

Sets the clipping rectangle for a surface. When this surface is the +destination of a blit, only the area within the clip rectangle will be +drawn into.

The rectangle pointed to by rect will be +clipped to the edges of the surface so that the clip rectangle for a +surface can never fall outside the edges of the surface.

If rect is NULL the clipping +rectangle will be set to the full size of the surface.


PrevHomeNext
SDL_SetAlphaUpSDL_GetClipRect
\ No newline at end of file diff --git a/docs/html/sdlsetcolorkey.html b/docs/html/sdlsetcolorkey.html new file mode 100644 index 0000000..0cb6695 --- /dev/null +++ b/docs/html/sdlsetcolorkey.html @@ -0,0 +1,321 @@ +SDL_SetColorKey
SDL Library Documentation
PrevNext

SDL_SetColorKey

Name

SDL_SetColorKey -- Sets the color key (transparent pixel) in a blittable surface and +RLE acceleration.

Synopsis

#include "SDL.h"

int SDL_SetColorKey(SDL_Surface *surface, Uint32 flag, Uint32 key);

Description

Sets the color key (transparent pixel) in a blittable surface and enables or + disables RLE blit acceleration.

RLE acceleration can substantially speed up blitting of images with large +horizontal runs of transparent pixels (i.e., pixels that match the +key value). The key must be of the same pixel format as the surface, SDL_MapRGB is often useful for obtaining an acceptable value.

If flag is SDL_SRCCOLORKEY then +key is the transparent pixel value in the source image of a +blit.

If flag is OR'd with +SDL_RLEACCEL then the surface will be draw using RLE +acceleration when drawn with +SDL_BlitSurface. The surface will +actually be encoded for RLE acceleration the first time +SDL_BlitSurface or +SDL_DisplayFormat is called on the +surface.

If flag is 0, this function clears +any current color key.

Return Value

This function returns 0, or +-1 if there was an error.


PrevHomeNext
SDL_SaveBMPUpSDL_SetAlpha
\ No newline at end of file diff --git a/docs/html/sdlsetcolors.html b/docs/html/sdlsetcolors.html new file mode 100644 index 0000000..5695645 --- /dev/null +++ b/docs/html/sdlsetcolors.html @@ -0,0 +1,358 @@ +SDL_SetColors
SDL Library Documentation
PrevNext

SDL_SetColors

Name

SDL_SetColors -- Sets a portion of the colormap for the given 8-bit surface.

Synopsis

#include "SDL.h"

int SDL_SetColors(SDL_Surface *surface, SDL_Color *colors, int firstcolor, int ncolors);

Description

Sets a portion of the colormap for the given 8-bit surface.

When surface is the surface associated with the current +display, the display colormap will be updated with the requested colors. If +SDL_HWPALETTE was set in SDL_SetVideoMode flags, +SDL_SetColors will always return 1, +and the palette is guaranteed to be set the way you desire, even if the window +colormap has to be warped or run under emulation.

The color components of a +SDL_Color +structure are 8-bits in size, giving you a total of 2563 +=16777216 colors.

Palettized (8-bit) screen surfaces with the SDL_HWPALETTE +flag have two palettes, a logical palette that is used for mapping blits +to/from the surface and a physical palette (that determines how the +hardware will map the colors to the display). SDL_SetColors +modifies both palettes (if present), and is equivalent to calling +SDL_SetPalette with the +flags set to +(SDL_LOGPAL | SDL_PHYSPAL).

Return Value

If surface is not a palettized surface, this function +does nothing, returning 0. If all of the colors were set +as passed to SDL_SetColors, it will return +1. If not all the color entries were set exactly as +given, it will return 0, and you should look at the +surface palette to determine the actual color palette.

Example

/* Create a display surface with a grayscale palette */
+SDL_Surface *screen;
+SDL_Color colors[256];
+int i;
+.
+.
+.
+/* Fill colors with color information */
+for(i=0;i<256;i++){
+  colors[i].r=i;
+  colors[i].g=i;
+  colors[i].b=i;
+}
+
+/* Create display */
+screen=SDL_SetVideoMode(640, 480, 8, SDL_HWPALETTE);
+if(!screen){
+  printf("Couldn't set video mode: %s\n", SDL_GetError());
+  exit(-1);
+}
+
+/* Set palette */
+SDL_SetColors(screen, colors, 0, 256);
+.
+.
+.
+.

PrevHomeNext
SDL_FlipUpSDL_SetPalette
\ No newline at end of file diff --git a/docs/html/sdlsetcursor.html b/docs/html/sdlsetcursor.html new file mode 100644 index 0000000..9c5443e --- /dev/null +++ b/docs/html/sdlsetcursor.html @@ -0,0 +1,222 @@ +SDL_SetCursor
SDL Library Documentation
PrevNext

SDL_SetCursor

Name

SDL_SetCursor -- Set the currently active mouse cursor.

Synopsis

#include "SDL.h"

void SDL_SetCursor(SDL_Cursor *cursor);

Description

Sets the currently active cursor to +the specified one. +If the cursor is currently visible, the change will be immediately +represented on the display.


PrevHomeNext
SDL_FreeCursorUpSDL_GetCursor
diff --git a/docs/html/sdlseteventfilter.html b/docs/html/sdlseteventfilter.html new file mode 100644 index 0000000..0808bab --- /dev/null +++ b/docs/html/sdlseteventfilter.html @@ -0,0 +1,284 @@ +SDL_SetEventFilter
SDL Library Documentation
PrevNext

SDL_SetEventFilter

Name

SDL_SetEventFilter -- Sets up a filter to process all events before they are posted +to the event queue.

Synopsis

#include "SDL.h"

void SDL_SetEventFilter(SDL_EventFilter filter);

Description

This function sets up a filter to process all events before they are posted +to the event queue. This is a very powerful and flexible feature. The filter +is prototyped as: +

typedef int (*SDL_EventFilter)(const SDL_Event *event);
+If the filter returns 1, then the event will be +added to the internal queue. If it returns 0, +then the event will be dropped from the queue. This allows selective +filtering of dynamically.

There is one caveat when dealing with the SDL_QUITEVENT event type. The +event filter is only called when the window manager desires to close the +application window. If the event filter returns 1, then the window will +be closed, otherwise the window will remain open if possible. +If the quit event is generated by an interrupt signal, it will bypass the +internal queue and be delivered to the application at the next event poll.

Note: Events pushed onto the queue with SDL_PushEvent or SDL_PeepEvents do not get passed through the event filter.

Note: Be Careful! The event filter function may run in a different thread so be careful what you do within it.


PrevHomeNext
SDL_PushEventUpSDL_GetEventFilter
\ No newline at end of file diff --git a/docs/html/sdlsetgamma.html b/docs/html/sdlsetgamma.html new file mode 100644 index 0000000..6443a96 --- /dev/null +++ b/docs/html/sdlsetgamma.html @@ -0,0 +1,231 @@ +SDL_SetGamma
SDL Library Documentation
PrevNext

SDL_SetGamma

Name

SDL_SetGamma -- Sets the color gamma function for the display

Synopsis

#include "SDL.h"

int SDL_SetGamma(float redgamma, float greengamma, float bluegamma);

Description

Sets the "gamma function" for the display of each color component. Gamma +controls the brightness/contrast of colors displayed on the screen. +A gamma value of 1.0 is identity (i.e., no adjustment +is made).

This function adjusts the gamma based on the "gamma function" parameter, +you can directly specify lookup tables for gamma adjustment with +SDL_SetGammaRamp.

Not all display hardware is able to change gamma.

Return Value

Returns -1 on error (or if gamma adjustment is not supported).


PrevHomeNext
SDL_SetPaletteUpSDL_GetGammaRamp
\ No newline at end of file diff --git a/docs/html/sdlsetgammaramp.html b/docs/html/sdlsetgammaramp.html new file mode 100644 index 0000000..79599c8 --- /dev/null +++ b/docs/html/sdlsetgammaramp.html @@ -0,0 +1,230 @@ +SDL_SetGammaRamp
SDL Library Documentation
PrevNext

SDL_SetGammaRamp

Name

SDL_SetGammaRamp -- Sets the color gamma lookup tables for the display

Synopsis

#include "SDL.h"

int SDL_SetGammaRamp(Uint16 *redtable, Uint16 *greentable, Uint16 *bluetable);

Description

Sets the gamma lookup tables for the display for each color component. +Each table is an array of 256 Uint16 values, representing a mapping +between the input and output for that channel. The input is the index +into the array, and the output is the 16-bit gamma value at that index, +scaled to the output color precision. You may pass NULL to any of the +channels to leave them unchanged.

This function adjusts the gamma based on lookup tables, you can also +have the gamma calculated based on a "gamma function" parameter with +SDL_SetGamma.

Not all display hardware is able to change gamma.

Return Value

Returns -1 on error (or if gamma adjustment is not supported).


PrevHomeNext
SDL_GetGammaRampUpSDL_MapRGB
\ No newline at end of file diff --git a/docs/html/sdlsetmodstate.html b/docs/html/sdlsetmodstate.html new file mode 100644 index 0000000..ee69a3f --- /dev/null +++ b/docs/html/sdlsetmodstate.html @@ -0,0 +1,237 @@ +SDL_SetModState
SDL Library Documentation
PrevNext

SDL_SetModState

Name

SDL_SetModState -- Set the current key modifier state

Synopsis

#include "SDL.h"

void SDL_SetModState(SDLMod modstate);

Description

The inverse of SDL_GetModState, SDL_SetModState allows you to impose modifier key states on your application.

Simply pass your desired modifier states into modstate. This value my be a logical OR'd combination of the following:

typedef enum {
+  KMOD_NONE  = 0x0000,
+  KMOD_LSHIFT= 0x0001,
+  KMOD_RSHIFT= 0x0002,
+  KMOD_LCTRL = 0x0040,
+  KMOD_RCTRL = 0x0080,
+  KMOD_LALT  = 0x0100,
+  KMOD_RALT  = 0x0200,
+  KMOD_LMETA = 0x0400,
+  KMOD_RMETA = 0x0800,
+  KMOD_NUM   = 0x1000,
+  KMOD_CAPS  = 0x2000,
+  KMOD_MODE  = 0x4000,
+} SDLMod;

PrevHomeNext
SDL_GetModStateUpSDL_GetKeyName
\ No newline at end of file diff --git a/docs/html/sdlsetpalette.html b/docs/html/sdlsetpalette.html new file mode 100644 index 0000000..1622f15 --- /dev/null +++ b/docs/html/sdlsetpalette.html @@ -0,0 +1,352 @@ +SDL_SetPalette
SDL Library Documentation
PrevNext

SDL_SetPalette

Name

SDL_SetPalette -- Sets the colors in the palette of an 8-bit surface.

Synopsis

#include "SDL.h"

int SDL_SetPalette(SDL_Surface *surface, int flags, SDL_Color *colors, int firstcolor, int ncolors);

Description

Sets a portion of the palette for the given 8-bit surface.

Palettized (8-bit) screen surfaces with the +SDL_HWPALETTE flag have two palettes, a logical +palette that is used for mapping blits to/from the surface and a +physical palette (that determines how the hardware will map the colors +to the display). SDL_BlitSurface +always uses the logical palette when blitting surfaces (if it has to +convert between surface pixel formats). Because of this, it is often +useful to modify only one or the other palette to achieve various +special color effects (e.g., screen fading, color flashes, screen dimming).

This function can modify either the logical or physical palette by +specifing SDL_LOGPAL or +SDL_PHYSPALthe in the flags +parameter.

When surface is the surface associated with the current +display, the display colormap will be updated with the requested colors. If +SDL_HWPALETTE was set in SDL_SetVideoMode flags, +SDL_SetPalette will always return 1, +and the palette is guaranteed to be set the way you desire, even if the window +colormap has to be warped or run under emulation.

The color components of a +SDL_Color structure +are 8-bits in size, giving you a total of +2563=16777216 colors.

Return Value

If surface is not a palettized surface, this function +does nothing, returning 0. If all of the colors were set +as passed to SDL_SetPalette, it will return +1. If not all the color entries were set exactly as +given, it will return 0, and you should look at the +surface palette to determine the actual color palette.

Example

        /* Create a display surface with a grayscale palette */
+        SDL_Surface *screen;
+        SDL_Color colors[256];
+        int i;
+        .
+        .
+        .
+        /* Fill colors with color information */
+        for(i=0;i<256;i++){
+          colors[i].r=i;
+          colors[i].g=i;
+          colors[i].b=i;
+        }
+
+        /* Create display */
+        screen=SDL_SetVideoMode(640, 480, 8, SDL_HWPALETTE);
+        if(!screen){
+          printf("Couldn't set video mode: %s\n", SDL_GetError());
+          exit(-1);
+        }
+
+        /* Set palette */
+        SDL_SetPalette(screen, SDL_LOGPAL|SDL_PHYSPAL, colors, 0, 256);
+        .
+        .
+        .
+        .

PrevHomeNext
SDL_SetColorsUpSDL_SetGamma
\ No newline at end of file diff --git a/docs/html/sdlsettimer.html b/docs/html/sdlsettimer.html new file mode 100644 index 0000000..40b737c --- /dev/null +++ b/docs/html/sdlsettimer.html @@ -0,0 +1,267 @@ +SDL_SetTimer
SDL Library Documentation
Prev 

SDL_SetTimer

Name

SDL_SetTimer -- Set a callback to run after the specified number of milliseconds has +elapsed.

Synopsis

#include "SDL.h"

int SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback);

Callback

/* Function prototype for the timer callback function */ +typedef Uint32 (*SDL_TimerCallback)(Uint32 interval);

Description

Set a callback to run after the specified number of milliseconds has +elapsed. The callback function is passed the current timer interval +and returns the next timer interval. If the returned value is the +same as the one passed in, the periodic alarm continues, otherwise a +new alarm is scheduled.

To cancel a currently running timer, call +SDL_SetTimer(0, NULL);

The timer callback function may run in a different thread than your +main constant, and so shouldn't call any functions from within itself.

The maximum resolution of this timer is 10 ms, which means that if +you request a 16 ms timer, your callback will run approximately 20 ms +later on an unloaded system. If you wanted to set a flag signaling +a frame update at 30 frames per second (every 33 ms), you might set a +timer for 30 ms (see example below).

If you use this function, you need to pass SDL_INIT_TIMER +to SDL_Init().

Note: This function is kept for compatibility but has been superseded +by the new timer functions +SDL_AddTimer and +SDL_RemoveTimer which support +multiple timers.

Examples

SDL_SetTimer((33/10)*10, my_callback);

See Also

SDL_AddTimer


PrevHome 
SDL_RemoveTimerUp 
\ No newline at end of file diff --git a/docs/html/sdlsetvideomode.html b/docs/html/sdlsetvideomode.html new file mode 100644 index 0000000..8b309b0 --- /dev/null +++ b/docs/html/sdlsetvideomode.html @@ -0,0 +1,558 @@ +SDL_SetVideoMode
SDL Library Documentation
PrevNext

SDL_SetVideoMode

Name

SDL_SetVideoMode -- Set up a video mode with the specified width, height and bits-per-pixel.

Synopsis

#include "SDL.h"

SDL_Surface *SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags);

Description

Set up a video mode with the specified width, height and bits-per-pixel.

If bpp is 0, it is treated as the +current display bits per pixel.

The flags parameter is the same as the flags field of the SDL_Surface structure. OR'd combinations of the following values are valid.

SDL_SWSURFACECreate the video surface in system memory
SDL_HWSURFACECreate the video surface in video memory
SDL_ASYNCBLITEnables the use of asynchronous updates of the display surface. This will +usually slow down blitting on single CPU machines, but may provide a speed +increase on SMP systems.
SDL_ANYFORMATNormally, if a video surface of the requested bits-per-pixel (bpp) is not available, SDL will emulate one with a shadow surface. Passing SDL_ANYFORMAT prevents this and causes SDL to use the video surface, regardless of its pixel depth.
SDL_HWPALETTEGive SDL exclusive palette access. Without this flag you may not always get the the colors you request with SDL_SetColors or SDL_SetPalette.
SDL_DOUBLEBUFEnable hardware double buffering; only valid with SDL_HWSURFACE. Calling +SDL_Flip will flip the +buffers and update the screen. All drawing will take place on the surface +that is not displayed at the moment. If double buffering could not be enabled +then SDL_Flip will just perform a +SDL_UpdateRect +on the entire screen.
SDL_FULLSCREENSDL will attempt to use a fullscreen mode. If a hardware resolution change is +not possible (for whatever reason), the next higher resolution will be used and +the display window centered on a black background.
SDL_OPENGLCreate an OpenGL rendering context. You should have previously set OpenGL video attributes with SDL_GL_SetAttribute.
SDL_OPENGLBLITCreate an OpenGL rendering context, like above, but allow normal blitting +operations. The screen (2D) surface may have an alpha channel, and +SDL_UpdateRects +must be used for updating changes to the screen surface. NOTE: This option +is kept for compatibility only, and is not recommended for +new code.
SDL_RESIZABLECreate a resizable window. When the window is resized by the user a SDL_VIDEORESIZE event is generated and SDL_SetVideoMode can be called again with the new size.
SDL_NOFRAMEIf possible, SDL_NOFRAME causes SDL to create a window with no title bar or frame decoration. Fullscreen modes automatically have this flag set.

Note: Whatever flags SDL_SetVideoMode could satisfy are set in the flags member of the returned surface.

Note: The bpp parameter is the number of bits per pixel, +so a bpp of 24 uses the packed representation of +3 bytes/pixel. For the more common 4 bytes/pixel mode, use a +bpp of 32. Somewhat oddly, both 15 and 16 will +request a 2 bytes/pixel mode, but different pixel formats.

Return Value

The framebuffer surface, or NULL if it fails. +The surface returned is freed by SDL_Quit() and should nt be freed by +the caller.


PrevHomeNext
SDL_VideoModeOKUpSDL_UpdateRect
\ No newline at end of file diff --git a/docs/html/sdlshowcursor.html b/docs/html/sdlshowcursor.html new file mode 100644 index 0000000..5a8f19d --- /dev/null +++ b/docs/html/sdlshowcursor.html @@ -0,0 +1,239 @@ +SDL_ShowCursor
SDL Library Documentation
PrevNext

SDL_ShowCursor

Name

SDL_ShowCursor -- Toggle whether or not the cursor is shown on the screen.

Synopsis

#include "SDL.h"

int SDL_ShowCursor(int toggle);

Description

Toggle whether or not the cursor is shown on the screen. Passing SDL_ENABLE displays the cursor and passing SDL_DISABLE hides it. The current state of the mouse cursor can be queried by passing SDL_QUERY, either SDL_DISABLE or SDL_ENABLE will be returned.

The cursor starts off displayed, but can be turned off.

Return Value

Returns the current state of the cursor.


PrevHomeNext
SDL_GetCursorUpSDL_GL_LoadLibrary
\ No newline at end of file diff --git a/docs/html/sdlsurface.html b/docs/html/sdlsurface.html new file mode 100644 index 0000000..fda55f1 --- /dev/null +++ b/docs/html/sdlsurface.html @@ -0,0 +1,597 @@ +SDL_Surface
SDL Library Documentation
PrevNext

SDL_Surface

Name

SDL_Surface -- Graphical Surface Structure

Structure Definition

typedef struct SDL_Surface {
+        Uint32 flags;                           /* Read-only */
+        SDL_PixelFormat *format;                /* Read-only */
+        int w, h;                               /* Read-only */
+        Uint16 pitch;                           /* Read-only */
+        void *pixels;                           /* Read-write */
+
+        /* clipping information */
+        SDL_Rect clip_rect;                     /* Read-only */
+
+        /* Reference count -- used when freeing surface */
+        int refcount;                           /* Read-mostly */
+
+	/* This structure also contains private fields not shown here */
+} SDL_Surface;

Structure Data

flagsSurface flags
formatPixel format
w, hWidth and height of the surface
pitchLength of a surface scanline in bytes
pixelsPointer to the actual pixel data
clip_rectsurface clip rectangle

Description

SDL_Surface's represent areas of "graphical" +memory, memory that can be drawn to. The video framebuffer is returned +as a SDL_Surface by +SDL_SetVideoMode +and SDL_GetVideoSurface. +Most of the fields should be pretty obvious. +w and h are the +width and height of the surface in pixels. +pixels is a pointer to the actual pixel data, +the surface should be locked +before accessing this field. The clip_rect field +is the clipping rectangle as set by +SDL_SetClipRect.

The following are supported in the +flags field.

SDL_SWSURFACESurface is stored in system memory
SDL_HWSURFACESurface is stored in video memory
SDL_ASYNCBLITSurface uses asynchronous blits if possible
SDL_ANYFORMATAllows any pixel-format (Display surface)
SDL_HWPALETTESurface has exclusive palette
SDL_DOUBLEBUFSurface is double buffered (Display surface)
SDL_FULLSCREENSurface is full screen (Display Surface)
SDL_OPENGLSurface has an OpenGL context (Display Surface)
SDL_OPENGLBLITSurface supports OpenGL blitting (Display Surface)
SDL_RESIZABLESurface is resizable (Display Surface)
SDL_HWACCELSurface blit uses hardware acceleration
SDL_SRCCOLORKEYSurface use colorkey blitting
SDL_RLEACCELColorkey blitting is accelerated with RLE
SDL_SRCALPHASurface blit uses alpha blending
SDL_PREALLOCSurface uses preallocated memory


PrevHomeNext
SDL_PixelFormatUpSDL_VideoInfo
\ No newline at end of file diff --git a/docs/html/sdlsyswmevent.html b/docs/html/sdlsyswmevent.html new file mode 100644 index 0000000..fd7180e --- /dev/null +++ b/docs/html/sdlsyswmevent.html @@ -0,0 +1,233 @@ +SDL_SysWMEvent
SDL Library Documentation
PrevNext

SDL_SysWMEvent

Name

SDL_SysWMEvent -- Platform-dependent window manager event.

Description

The system window manager event contains a pointer to system-specific +information about unknown window manager events. If you enable this event +using +SDL_EventState(), +it will be generated whenever unhandled events are received from the window +manager. This can be used, for example, to implement cut-and-paste in your +application. + +

typedef struct {
+         Uint8 type;   /* Always SDL_SYSWMEVENT */
+         SDL_SysWMmsg *msg;
+ } SDL_SysWMEvent;
+ +If you want to obtain system-specific information about the window manager, +you can fill the version member of a SDL_SysWMinfo +structure (details can be found in SDL_syswm.h, which must be included) using the SDL_VERSION() macro found in +SDL_version.h, and pass it to the +function: +

int SDL_GetWMInfo(SDL_SysWMinfo *info);


PrevHomeNext
SDL_ExposeEventUpSDL_UserEvent
\ No newline at end of file diff --git a/docs/html/sdlthreadid.html b/docs/html/sdlthreadid.html new file mode 100644 index 0000000..e0bde2e --- /dev/null +++ b/docs/html/sdlthreadid.html @@ -0,0 +1,190 @@ +SDL_ThreadID
SDL Library Documentation
PrevNext

SDL_ThreadID

Name

SDL_ThreadID -- Get the 32-bit thread identifier for the current thread.

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

Uint32 SDL_ThreadID(void);

Description

Get the 32-bit thread identifier for the current thread.


PrevHomeNext
SDL_CreateThreadUpSDL_GetThreadID
\ No newline at end of file diff --git a/docs/html/sdlunlockaudio.html b/docs/html/sdlunlockaudio.html new file mode 100644 index 0000000..0019bd6 --- /dev/null +++ b/docs/html/sdlunlockaudio.html @@ -0,0 +1,211 @@ +SDL_UnlockAudio
SDL Library Documentation
PrevNext

SDL_UnlockAudio

Name

SDL_UnlockAudio -- Unlock the callback function

Synopsis

#include "SDL.h"

void SDL_UnlockAudio(void);

Description

Unlocks a previous SDL_LockAudio call.


PrevHomeNext
SDL_LockAudioUpSDL_CloseAudio
\ No newline at end of file diff --git a/docs/html/sdlunlocksurface.html b/docs/html/sdlunlocksurface.html new file mode 100644 index 0000000..13ba5fc --- /dev/null +++ b/docs/html/sdlunlocksurface.html @@ -0,0 +1,219 @@ +SDL_UnlockSurface
SDL Library Documentation
PrevNext

SDL_UnlockSurface

Name

SDL_UnlockSurface -- Unlocks a previously locked surface.

Synopsis

#include "SDL.h"

void SDL_UnlockSurface(SDL_Surface *surface);

Description

Surfaces that were previously locked using SDL_LockSurface must be unlocked with SDL_UnlockSurface. Surfaces should be unlocked as soon as possible.

It should be noted that since 1.1.8, surface locks are recursive. See SDL_LockSurface.


PrevHomeNext
SDL_LockSurfaceUpSDL_LoadBMP
\ No newline at end of file diff --git a/docs/html/sdlunlockyuvoverlay.html b/docs/html/sdlunlockyuvoverlay.html new file mode 100644 index 0000000..936ed9e --- /dev/null +++ b/docs/html/sdlunlockyuvoverlay.html @@ -0,0 +1,225 @@ +SDL_UnlockYUVOverlay
SDL Library Documentation
PrevNext

SDL_UnlockYUVOverlay

Name

SDL_UnlockYUVOverlay -- Unlock an overlay

Synopsis

#include "SDL.h"

void SDL_UnlockYUVOverlay(SDL_Overlay *overlay);

Description

The opposite to SDL_LockYUVOverlay. Unlocks a previously locked overlay. An overlay must be unlocked before it can be displayed.


PrevHomeNext
SDL_LockYUVOverlayUpSDL_DisplayYUVOverlay
\ No newline at end of file diff --git a/docs/html/sdlupdaterect.html b/docs/html/sdlupdaterect.html new file mode 100644 index 0000000..f54d9f5 --- /dev/null +++ b/docs/html/sdlupdaterect.html @@ -0,0 +1,266 @@ +SDL_UpdateRect
SDL Library Documentation
PrevNext

SDL_UpdateRect

Name

SDL_UpdateRect -- Makes sure the given area is updated on the given screen.

Synopsis

#include "SDL.h"

void SDL_UpdateRect(SDL_Surface *screen, Sint32 x, Sint32 y, Sint32 w, Sint32 h);

Description

Makes sure the given area is updated on the given screen. The rectangle must +be confined within the screen boundaries (no clipping is done).

If 'x', 'y', 'w' +and 'h' are all 0, +SDL_UpdateRect will update the +entire screen.

This function should not be called while 'screen' is +locked.


PrevHomeNext
SDL_SetVideoModeUpSDL_UpdateRects
\ No newline at end of file diff --git a/docs/html/sdlupdaterects.html b/docs/html/sdlupdaterects.html new file mode 100644 index 0000000..0553a7a --- /dev/null +++ b/docs/html/sdlupdaterects.html @@ -0,0 +1,255 @@ +SDL_UpdateRects
SDL Library Documentation
PrevNext

SDL_UpdateRects

Name

SDL_UpdateRects -- Makes sure the given list of rectangles is updated on the given screen.

Synopsis

#include "SDL.h"

void SDL_UpdateRects(SDL_Surface *screen, int numrects, SDL_Rect *rects);

Description

Makes sure the given list of rectangles is updated on the given screen. +The rectangles must all be confined within the screen boundaries (no +clipping is done).

This function should not be called while screen is +locked.

Note: It is adviced to call this function only once per frame, since each +call has some processing overhead. This is no restriction since you +can pass any number of rectangles each time.

The rectangles are not automatically merged or checked for overlap. In +general, the programmer can use his knowledge about his particular +rectangles to merge them in an efficient way, to avoid overdraw.


PrevHomeNext
SDL_UpdateRectUpSDL_Flip
\ No newline at end of file diff --git a/docs/html/sdluserevent.html b/docs/html/sdluserevent.html new file mode 100644 index 0000000..178769c --- /dev/null +++ b/docs/html/sdluserevent.html @@ -0,0 +1,337 @@ +SDL_UserEvent
SDL Library Documentation
PrevNext

SDL_UserEvent

Name

SDL_UserEvent -- A user-defined event type

Structure Definition

typedef struct{
+  Uint8 type;
+  int code;
+  void *data1;
+  void *data2;
+} SDL_UserEvent;

Structure Data

typeSDL_USEREVENT through to SDL_NUMEVENTS-1
codeUser defined event code
data1User defined data pointer
data2User defined data pointer

Description

SDL_UserEvent is in the user member of the structure SDL_Event. This event is unique, it is never created by SDL but only by the user. The event can be pushed onto the event queue using SDL_PushEvent. The contents of the structure members or completely up to the programmer, the only requirement is that type is a value from SDL_USEREVENT to SDL_NUMEVENTS-1 (inclusive).

Examples

SDL_Event event;
+
+event.type = SDL_USEREVENT;
+event.user.code = my_event_code;
+event.user.data1 = significant_data;
+event.user.data2 = 0;
+SDL_PushEvent(&event);


PrevHomeNext
SDL_SysWMEventUpSDL_QuitEvent
\ No newline at end of file diff --git a/docs/html/sdlvideodrivername.html b/docs/html/sdlvideodrivername.html new file mode 100644 index 0000000..1419656 --- /dev/null +++ b/docs/html/sdlvideodrivername.html @@ -0,0 +1,243 @@ +SDL_VideoDriverName
SDL Library Documentation
PrevNext

SDL_VideoDriverName

Name

SDL_VideoDriverName -- Obtain the name of the video driver

Synopsis

#include "SDL.h"

char *SDL_VideoDriverName(char *namebuf, int maxlen);

Description

The buffer pointed to by namebuf is filled up to a maximum of maxlen characters (include the NULL terminator) with the name of the initialised video driver. The driver name is a simple one word identifier like "x11" or "windib".

Return Value

Returns NULL if video has not been initialised with SDL_Init or a pointer to namebuf otherwise.


PrevHomeNext
SDL_GetVideoInfoUpSDL_ListModes
\ No newline at end of file diff --git a/docs/html/sdlvideoinfo.html b/docs/html/sdlvideoinfo.html new file mode 100644 index 0000000..3a0da31 --- /dev/null +++ b/docs/html/sdlvideoinfo.html @@ -0,0 +1,408 @@ +SDL_VideoInfo
SDL Library Documentation
PrevNext

SDL_VideoInfo

Name

SDL_VideoInfo -- Video Target information

Structure Definition

typedef struct{
+  Uint32 hw_available:1;
+  Uint32 wm_available:1;
+  Uint32 blit_hw:1;
+  Uint32 blit_hw_CC:1;
+  Uint32 blit_hw_A:1;
+  Uint32 blit_sw:1;
+  Uint32 blit_sw_CC:1;
+  Uint32 blit_sw_A:1;
+  Uint32 blit_fill;
+  Uint32 video_mem;
+  SDL_PixelFormat *vfmt;
+} SDL_VideoInfo;

Structure Data

hw_availableIs it possible to create hardware surfaces?
wm_availableIs there a window manager available
blit_hwAre hardware to hardware blits accelerated?
blit_hw_CCAre hardware to hardware colorkey blits accelerated?
blit_hw_AAre hardware to hardware alpha blits accelerated?
blit_swAre software to hardware blits accelerated?
blit_sw_CCAre software to hardware colorkey blits accelerated?
blit_sw_AAre software to hardware alpha blits accelerated?
blit_fillAre color fills accelerated?
video_memTotal amount of video memory in Kilobytes
vfmtPixel format of the video device

Description

This (read-only) structure is returned by SDL_GetVideoInfo. It contains information on either the 'best' available mode (if called before SDL_SetVideoMode) or the current video mode.


PrevHomeNext
SDL_SurfaceUpSDL_Overlay
\ No newline at end of file diff --git a/docs/html/sdlvideomodeok.html b/docs/html/sdlvideomodeok.html new file mode 100644 index 0000000..5d2d6c4 --- /dev/null +++ b/docs/html/sdlvideomodeok.html @@ -0,0 +1,270 @@ +SDL_VideoModeOK
SDL Library Documentation
PrevNext

SDL_VideoModeOK

Name

SDL_VideoModeOK -- Check to see if a particular video mode is supported.

Synopsis

#include "SDL.h"

int SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags);

Description

SDL_VideoModeOK returns 0 +if the requested mode is not supported under any bit depth, or returns the +bits-per-pixel of the closest available mode with the given width, height and requested surface flags (see SDL_SetVideoMode).

The bits-per-pixel value returned is only a suggested mode. You can usually request and bpp you want when setting the video mode and SDL will emulate that color depth with a shadow video surface.

The arguments to SDL_VideoModeOK are the same ones you +would pass to SDL_SetVideoMode

Example

SDL_Surface *screen;
+Uint32 bpp;
+.
+.
+.
+printf("Checking mode 640x480@16bpp.\n");
+bpp=SDL_VideoModeOK(640, 480, 16, SDL_HWSURFACE);
+
+if(!bpp){
+  printf("Mode not available.\n");
+  exit(-1);
+}
+
+printf("SDL Recommends 640x480@%dbpp.\n", bpp);
+screen=SDL_SetVideoMode(640, 480, bpp, SDL_HWSURFACE);
+.
+.

PrevHomeNext
SDL_ListModesUpSDL_SetVideoMode
\ No newline at end of file diff --git a/docs/html/sdlwaitevent.html b/docs/html/sdlwaitevent.html new file mode 100644 index 0000000..b473d3b --- /dev/null +++ b/docs/html/sdlwaitevent.html @@ -0,0 +1,231 @@ +SDL_WaitEvent
SDL Library Documentation
PrevNext

SDL_WaitEvent

Name

SDL_WaitEvent -- Waits indefinitely for the next available event.

Synopsis

#include "SDL.h"

int SDL_WaitEvent(SDL_Event *event);

Description

Waits indefinitely for the next available event, returning +1, or 0 if there was +an error while waiting for events.

If event is not NULL, the next +event is removed from the queue and stored in that area.


PrevHomeNext
SDL_PollEventUpSDL_PushEvent
\ No newline at end of file diff --git a/docs/html/sdlwaitthread.html b/docs/html/sdlwaitthread.html new file mode 100644 index 0000000..2becfbc --- /dev/null +++ b/docs/html/sdlwaitthread.html @@ -0,0 +1,231 @@ +SDL_WaitThread
SDL Library Documentation
PrevNext

SDL_WaitThread

Name

SDL_WaitThread -- Wait for a thread to finish.

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

void SDL_WaitThread(SDL_Thread *thread, int *status);

Description

Wait for a thread to finish (timeouts are not supported).

Return Value

The return code for the thread function is placed in the area pointed to by +status, if status is not +NULL.


PrevHomeNext
SDL_GetThreadIDUpSDL_KillThread
\ No newline at end of file diff --git a/docs/html/sdlwarpmouse.html b/docs/html/sdlwarpmouse.html new file mode 100644 index 0000000..e7b2d8d --- /dev/null +++ b/docs/html/sdlwarpmouse.html @@ -0,0 +1,205 @@ +SDL_WarpMouse
SDL Library Documentation
PrevNext

SDL_WarpMouse

Name

SDL_WarpMouse -- Set the position of the mouse cursor.

Synopsis

#include "SDL.h"

void SDL_WarpMouse(Uint16 x, Uint16 y);

Description

Set the position of the mouse cursor (generates a mouse motion event).


PrevHomeNext
SDL_DisplayFormatAlphaUpSDL_CreateCursor
\ No newline at end of file diff --git a/docs/html/sdlwasinit.html b/docs/html/sdlwasinit.html new file mode 100644 index 0000000..b4effeb --- /dev/null +++ b/docs/html/sdlwasinit.html @@ -0,0 +1,284 @@ +SDL_WasInit
SDL Library Documentation
PrevNext

SDL_WasInit

Name

SDL_WasInit -- Check which subsystems are initialized

Synopsis

#include "SDL.h"

Uint32 SDL_WasInit(Uint32 flags);

Description

SDL_WasInit allows you to see which SDL subsytems have been initialized. flags is a bitwise OR'd combination of the subsystems you wish to check (see SDL_Init for a list of subsystem flags).

Return Value

SDL_WasInit returns a bitwised OR'd combination of the initialized subsystems.

Examples


/* Here are several ways you can use SDL_WasInit() */
+
+/* Get init data on all the subsystems */
+Uint32 subsystem_init;
+
+subsystem_init=SDL_WasInit(SDL_INIT_EVERYTHING);
+
+if(subsystem_init&SDL_INIT_VIDEO)
+  printf("Video is initialized.\n");
+else
+  printf("Video is not initialized.\n");
+
+
+
+/* Just check for one specfic subsystem */
+
+if(SDL_WasInit(SDL_INIT_VIDEO)!=0)
+  printf("Video is initialized.\n");
+else
+  printf("Video is not initialized.\n");
+
+
+
+
+/* Check for two subsystems */
+
+Uint32 subsystem_mask=SDL_INIT_VIDEO|SDL_INIT_AUDIO;
+
+if(SDL_WasInit(subsystem_mask)==subsystem_mask)
+  printf("Video and Audio initialized.\n");
+else
+  printf("Video and Audio not initialized.\n");

PrevHomeNext
SDL_QuitUpSDL_GetError
\ No newline at end of file diff --git a/docs/html/sdlwmgetcaption.html b/docs/html/sdlwmgetcaption.html new file mode 100644 index 0000000..829c68a --- /dev/null +++ b/docs/html/sdlwmgetcaption.html @@ -0,0 +1,222 @@ +SDL_WM_GetCaption
SDL Library Documentation
PrevNext

SDL_WM_GetCaption

Name

SDL_WM_GetCaption -- Gets the window title and icon name.

Synopsis

#include "SDL.h"

void SDL_WM_GetCaption(char **title, char **icon);

Description

Set pointers to the window title and icon name.


PrevHomeNext
SDL_WM_SetCaptionUpSDL_WM_SetIcon
\ No newline at end of file diff --git a/docs/html/sdlwmgrabinput.html b/docs/html/sdlwmgrabinput.html new file mode 100644 index 0000000..740dcd6 --- /dev/null +++ b/docs/html/sdlwmgrabinput.html @@ -0,0 +1,224 @@ +SDL_WM_GrabInput
SDL Library Documentation
PrevNext

SDL_WM_GrabInput

Name

SDL_WM_GrabInput -- Grabs mouse and keyboard input.

Synopsis

#include "SDL.h"

SDL_GrabMode SDL_WM_GrabInput(SDL_GrabMode mode);

Description

Grabbing means that the mouse is confined to the application window, +and nearly all keyboard input is passed directly to the application, +and not interpreted by a window manager, if any.

When mode is SDL_GRAB_QUERY the grab mode is not changed, but the current grab mode is returned.

typedef enum {
+  SDL_GRAB_QUERY,
+  SDL_GRAB_OFF,
+  SDL_GRAB_ON
+} SDL_GrabMode;
+

Return Value

The current/new SDL_GrabMode.


PrevHomeNext
SDL_WM_ToggleFullScreenUpEvents
\ No newline at end of file diff --git a/docs/html/sdlwmiconifywindow.html b/docs/html/sdlwmiconifywindow.html new file mode 100644 index 0000000..1113656 --- /dev/null +++ b/docs/html/sdlwmiconifywindow.html @@ -0,0 +1,211 @@ +SDL_WM_IconifyWindow
SDL Library Documentation
PrevNext

SDL_WM_IconifyWindow

Name

SDL_WM_IconifyWindow -- Iconify/Minimise the window

Synopsis

#include "SDL.h"

int SDL_WM_IconifyWindow(void);

Description

If the application is running in a window managed environment SDL attempts to iconify/minimise it. If SDL_WM_IconifyWindow is successful, the application will receive a SDL_APPACTIVE loss event.

Return Value

Returns non-zero on success or 0 if iconification is not support or was refused by the window manager.


PrevHomeNext
SDL_WM_SetIconUpSDL_WM_ToggleFullScreen
\ No newline at end of file diff --git a/docs/html/sdlwmsetcaption.html b/docs/html/sdlwmsetcaption.html new file mode 100644 index 0000000..bc47c27 --- /dev/null +++ b/docs/html/sdlwmsetcaption.html @@ -0,0 +1,212 @@ +SDL_WM_SetCaption
SDL Library Documentation
PrevNext

SDL_WM_SetCaption

Name

SDL_WM_SetCaption -- Sets the window tile and icon name.

Synopsis

#include "SDL.h"

void SDL_WM_SetCaption(const char *title, const char *icon);

Description

Sets the title-bar and icon name of the display window.


PrevHomeNext
Window ManagementUpSDL_WM_GetCaption
\ No newline at end of file diff --git a/docs/html/sdlwmseticon.html b/docs/html/sdlwmseticon.html new file mode 100644 index 0000000..12eb207 --- /dev/null +++ b/docs/html/sdlwmseticon.html @@ -0,0 +1,260 @@ +SDL_WM_SetIcon
SDL Library Documentation
PrevNext

SDL_WM_SetIcon

Name

SDL_WM_SetIcon -- Sets the icon for the display window.

Synopsis

#include "SDL.h"

void SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask);

Description

Sets the icon for the display window. Win32 icons must be 32x32.

This function must be called before the first call to +SDL_SetVideoMode.

The mask is a bitmask that describes the shape of the +icon. If mask is NULL, then the shape is determined by +the colorkey of icon, if any, or makes the icon +rectangular (no transparency) otherwise.

If mask is non-NULL, it points to a bitmap with bits set +where the corresponding pixel should be visible. The format of the bitmap is as +follows: Scanlines come in the usual top-down order. Each scanline consists of +(width / 8) bytes, rounded up. The most significant bit of each byte represents +the leftmost pixel.

Example

SDL_WM_SetIcon(SDL_LoadBMP("icon.bmp"), NULL);

PrevHomeNext
SDL_WM_GetCaptionUpSDL_WM_IconifyWindow
\ No newline at end of file diff --git a/docs/html/sdlwmtogglefullscreen.html b/docs/html/sdlwmtogglefullscreen.html new file mode 100644 index 0000000..b7973de --- /dev/null +++ b/docs/html/sdlwmtogglefullscreen.html @@ -0,0 +1,205 @@ +SDL_WM_ToggleFullScreen
SDL Library Documentation
PrevNext

SDL_WM_ToggleFullScreen

Name

SDL_WM_ToggleFullScreen -- Toggles fullscreen mode

Synopsis

#include "SDL.h"

int SDL_WM_ToggleFullScreen(SDL_Surface *surface);

Description

Toggles the application between windowed and fullscreen mode, if supported. (X11 is the only target currently supported, BeOS support is experimental).

Return Value

Returns 0 on failure or 1 on success.


PrevHomeNext
SDL_WM_IconifyWindowUpSDL_WM_GrabInput
\ No newline at end of file diff --git a/docs/html/thread.html b/docs/html/thread.html new file mode 100644 index 0000000..c66018e --- /dev/null +++ b/docs/html/thread.html @@ -0,0 +1,313 @@ +Multi-threaded Programming
SDL Library Documentation
PrevNext

Chapter 12. Multi-threaded Programming

Table of Contents
SDL_CreateThread -- Creates a new thread of execution that shares its parent's properties.
SDL_ThreadID -- Get the 32-bit thread identifier for the current thread.
SDL_GetThreadID -- Get the SDL thread ID of a SDL_Thread
SDL_WaitThread -- Wait for a thread to finish.
SDL_KillThread -- Gracelessly terminates the thread.
SDL_CreateMutex -- Create a mutex
SDL_DestroyMutex -- Destroy a mutex
SDL_mutexP -- Lock a mutex
SDL_mutexV -- Unlock a mutex
SDL_CreateSemaphore -- Creates a new semaphore and assigns an initial value to it.
SDL_DestroySemaphore -- Destroys a semaphore that was created by SDL_CreateSemaphore.
SDL_SemWait -- Lock a semaphore and suspend the thread if the semaphore value is zero.
SDL_SemTryWait -- Attempt to lock a semaphore but don't suspend the thread.
SDL_SemWaitTimeout -- Lock a semaphore, but only wait up to a specified maximum time.
SDL_SemPost -- Unlock a semaphore.
SDL_SemValue -- Return the current value of a semaphore.
SDL_CreateCond -- Create a condition variable
SDL_DestroyCond -- Destroy a condition variable
SDL_CondSignal -- Restart a thread wait on a condition variable
SDL_CondBroadcast -- Restart all threads waiting on a condition variable
SDL_CondWait -- Wait on a condition variable
SDL_CondWaitTimeout -- Wait on a condition variable, with timeout

SDL provides functions for creating threads, mutexes, semphores and condition variables.

In general, you must be very aware of concurrency and data integrity issues +when writing multi-threaded programs. Some good guidelines include: +

  • Don't call SDL video/event functions from separate threads

  • Don't use any library functions in separate threads

  • Don't perform any memory management in separate threads

  • Lock global variables which may be accessed by multiple threads

  • Never terminate threads, always set a flag and wait for them to quit

  • Think very carefully about all possible ways your code may interact

Note: SDL's threading is not implemented on MacOS, due to that lack of preemptive thread support (Mac OS X dos nt suffer from this problem)


PrevHomeNext
SDL_CDtrackUpSDL_CreateThread
\ No newline at end of file diff --git a/docs/html/time.html b/docs/html/time.html new file mode 100644 index 0000000..854b7cb --- /dev/null +++ b/docs/html/time.html @@ -0,0 +1,206 @@ +Time
SDL Library Documentation
PrevNext

Chapter 13. Time

Table of Contents
SDL_GetTicks -- Get the number of milliseconds since the SDL library initialization.
SDL_Delay -- Wait a specified number of milliseconds before returning.
SDL_AddTimer -- Add a timer which will call a callback after the specified number of milliseconds has +elapsed.
SDL_RemoveTimer -- Remove a timer which was added with +SDL_AddTimer.
SDL_SetTimer -- Set a callback to run after the specified number of milliseconds has +elapsed.

SDL provides several cross-platform functions for dealing with time. +It provides a way to get the current time, a way to wait a little while, +and a simple timer mechanism. These functions give you two ways of moving an +object every x milliseconds: + +

  • Use a timer callback function. This may have the bad effect that it runs in a seperate thread or uses alarm signals, but it's easier to implement.

  • Or you can get the number of milliseconds passed, and move the object if, for example, 30 ms passed.


PrevHomeNext
SDL_CondWaitTimeoutUpSDL_GetTicks
\ No newline at end of file diff --git a/docs/html/video.html b/docs/html/video.html new file mode 100644 index 0000000..9b1434e --- /dev/null +++ b/docs/html/video.html @@ -0,0 +1,507 @@ +Video
SDL Library Documentation
PrevNext

Chapter 6. Video

Table of Contents
SDL_GetVideoSurface -- returns a pointer to the current display surface
SDL_GetVideoInfo -- returns a pointer to information about the video hardware
SDL_VideoDriverName -- Obtain the name of the video driver
SDL_ListModes -- Returns a pointer to an array of available screen dimensions for +the given format and video flags
SDL_VideoModeOK -- Check to see if a particular video mode is supported.
SDL_SetVideoMode -- Set up a video mode with the specified width, height and bits-per-pixel.
SDL_UpdateRect -- Makes sure the given area is updated on the given screen.
SDL_UpdateRects -- Makes sure the given list of rectangles is updated on the given screen.
SDL_Flip -- Swaps screen buffers
SDL_SetColors -- Sets a portion of the colormap for the given 8-bit surface.
SDL_SetPalette -- Sets the colors in the palette of an 8-bit surface.
SDL_SetGamma -- Sets the color gamma function for the display
SDL_GetGammaRamp -- Gets the color gamma lookup tables for the display
SDL_SetGammaRamp -- Sets the color gamma lookup tables for the display
SDL_MapRGB -- Map a RGB color value to a pixel format.
SDL_MapRGBA -- Map a RGBA color value to a pixel format.
SDL_GetRGB -- Get RGB values from a pixel in the specified pixel format.
SDL_GetRGBA -- Get RGBA values from a pixel in the specified pixel format.
SDL_CreateRGBSurface -- Create an empty SDL_Surface
SDL_CreateRGBSurfaceFrom -- Create an SDL_Surface from pixel data
SDL_FreeSurface -- Frees (deletes) a SDL_Surface
SDL_LockSurface -- Lock a surface for directly access.
SDL_UnlockSurface -- Unlocks a previously locked surface.
SDL_LoadBMP -- Load a Windows BMP file into an SDL_Surface.
SDL_SaveBMP -- Save an SDL_Surface as a Windows BMP file.
SDL_SetColorKey -- Sets the color key (transparent pixel) in a blittable surface and +RLE acceleration.
SDL_SetAlpha -- Adjust the alpha properties of a surface
SDL_SetClipRect -- Sets the clipping rectangle for a surface.
SDL_GetClipRect -- Gets the clipping rectangle for a surface.
SDL_ConvertSurface -- Converts a surface to the same format as another surface.
SDL_BlitSurface -- This performs a fast blit from the source surface to the destination surface.
SDL_FillRect -- This function performs a fast fill of the given rectangle with some color
SDL_DisplayFormat -- Convert a surface to the display format
SDL_DisplayFormatAlpha -- Convert a surface to the display format
SDL_WarpMouse -- Set the position of the mouse cursor.
SDL_CreateCursor -- Creates a new mouse cursor.
SDL_FreeCursor -- Frees a cursor created with SDL_CreateCursor.
SDL_SetCursor -- Set the currently active mouse cursor.
SDL_GetCursor -- Get the currently active mouse cursor.
SDL_ShowCursor -- Toggle whether or not the cursor is shown on the screen.
SDL_GL_LoadLibrary -- Specify an OpenGL library
SDL_GL_GetProcAddress -- Get the address of a GL function
SDL_GL_GetAttribute -- Get the value of a special SDL/OpenGL attribute
SDL_GL_SetAttribute -- Set a special SDL/OpenGL attribute
SDL_GL_SwapBuffers -- Swap OpenGL framebuffers/Update Display
SDL_CreateYUVOverlay -- Create a YUV video overlay
SDL_LockYUVOverlay -- Lock an overlay
SDL_UnlockYUVOverlay -- Unlock an overlay
SDL_DisplayYUVOverlay -- Blit the overlay to the display
SDL_FreeYUVOverlay -- Free a YUV video overlay
SDL_GLattr -- SDL GL Attributes
SDL_Rect -- Defines a rectangular area
SDL_Color -- Format independent color description
SDL_Palette -- Color palette for 8-bit pixel formats
SDL_PixelFormat -- Stores surface format information
SDL_Surface -- Graphical Surface Structure
SDL_VideoInfo -- Video Target information
SDL_Overlay -- YUV video overlay

SDL presents a very simple interface to the display framebuffer. The +framebuffer is represented as an offscreen surface to which you can write +directly. If you want the screen to show what you have written, call the update function which will +guarantee that the desired portion of the screen is updated.

Before you call any of the SDL video functions, you must first call +SDL_Init(SDL_INIT_VIDEO), which initializes the video +and events in the SDL library. Check the return code, which should be +0, to see if there were any errors in starting up.

If you use both sound and video in your application, you need to call +SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO) before opening the +sound device, otherwise under Win32 DirectX, you won't be able to set +full-screen display modes.

After you have initialized the library, you can start up the video display in a +number of ways. The easiest way is to pick a common screen resolution and +depth and just initialize the video, checking for errors. You will probably +get what you want, but SDL may be emulating your requested mode and converting +the display on update. The best way is to +query, for the best +video mode closest to the desired one, and then +convert +your images to that pixel format.

SDL currently supports any bit depth >= 8 bits per pixel. 8 bpp formats are +considered 8-bit palettized modes, while 12, 15, 16, 24, and 32 bits per pixel +are considered "packed pixel" modes, meaning each pixel contains the RGB color +components packed in the bits of the pixel.

After you have initialized your video mode, you can take the surface that was +returned, and write to it like any other framebuffer, calling the update +routine as you go.

When you have finished your video access and are ready to quit your +application, you should call "SDL_Quit()" to shutdown the +video and events.


PrevHomeNext
SDL_envvarsUpSDL_GetVideoSurface
\ No newline at end of file diff --git a/docs/html/wm.html b/docs/html/wm.html new file mode 100644 index 0000000..f53a349 --- /dev/null +++ b/docs/html/wm.html @@ -0,0 +1,188 @@ +Window Management
SDL Library Documentation
PrevNext

Chapter 7. Window Management

Table of Contents
SDL_WM_SetCaption -- Sets the window tile and icon name.
SDL_WM_GetCaption -- Gets the window title and icon name.
SDL_WM_SetIcon -- Sets the icon for the display window.
SDL_WM_IconifyWindow -- Iconify/Minimise the window
SDL_WM_ToggleFullScreen -- Toggles fullscreen mode
SDL_WM_GrabInput -- Grabs mouse and keyboard input.

SDL provides a small set of window management functions which allow applications to change their title and toggle from windowed mode to fullscreen (if available)


PrevHomeNext
SDL_OverlayUpSDL_WM_SetCaption
\ No newline at end of file diff --git a/docs/images/rainbow.gif b/docs/images/rainbow.gif new file mode 100644 index 0000000..07eb184 Binary files /dev/null and b/docs/images/rainbow.gif differ diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..7d57253 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,55 @@ + + +Simple DirectMedia Layer Introduction + + +
+

Simple DirectMedia Layer Introduction

+

+This library is designed to make it easy to write games that run on many +different platforms using the various native high-performance media interfaces, +(for video, audio, etc) and presenting a single source-code level API to +your application. This is a fairly low level API, but using this, completely +portable applications can be written with a great deal of flexibility. +

+An introduction to SDL can be found online at: + + http://www.libsdl.org/intro.php +

+Tutorials on a variety of topics can be found online at: + + http://www.libsdl.org/tutorials.php +

+Documentation in Wiki form can be found online at: + + http://www.libsdl.org/cgi/docwiki.cgi/ +

+Enjoy! +

+    Sam Lantinga + +

+


+

Table of Contents

+ +
diff --git a/docs/man3/SDLKey.3 b/docs/man3/SDLKey.3 new file mode 100644 index 0000000..dc74dfa --- /dev/null +++ b/docs/man3/SDLKey.3 @@ -0,0 +1,161 @@ +.TH "SDLKey" "3" "Wed 11 Oct 2000, 22:28" "SDL" "SDL API Reference" +.SH "NAME" +SDLKey \- SDL Keysym Definitions +.SH "SDL Keysym definitions" +.PP +\fBSDLKey ASCII value Common Name\fR +.nf +\f(CWSDLK_BACKSPACE '\\b' backspace +SDLK_TAB '\\t' tab +SDLK_CLEAR clear +SDLK_RETURN '\\r' return +SDLK_PAUSE pause +SDLK_ESCAPE '^[' escape +SDLK_SPACE ' ' space +SDLK_EXCLAIM '!' exclaim +SDLK_QUOTEDBL '"' quotedbl +SDLK_HASH '#' hash +SDLK_DOLLAR '$' dollar +SDLK_AMPERSAND '&' ampersand +SDLK_QUOTE ''' quote +SDLK_LEFTPAREN '(' left parenthesis +SDLK_RIGHTPAREN ')' right parenthesis +SDLK_ASTERISK '*' asterisk +SDLK_PLUS '+' plus sign +SDLK_COMMA ',' comma +SDLK_MINUS '-' minus sign +SDLK_PERIOD '.' period +SDLK_SLASH '/' forward slash +SDLK_0 '0' 0 +SDLK_1 '1' 1 +SDLK_2 '2' 2 +SDLK_3 '3' 3 +SDLK_4 '4' 4 +SDLK_5 '5' 5 +SDLK_6 '6' 6 +SDLK_7 '7' 7 +SDLK_8 '8' 8 +SDLK_9 '9' 9 +SDLK_COLON ':' colon +SDLK_SEMICOLON ';' semicolon +SDLK_LESS '<' less-than sign +SDLK_EQUALS '=' equals sign +SDLK_GREATER '>' greater-than sign +SDLK_QUESTION '?' question mark +SDLK_AT '@' at +SDLK_LEFTBRACKET '[' left bracket +SDLK_BACKSLASH '\\' backslash +SDLK_RIGHTBRACKET ']' right bracket +SDLK_CARET '^' caret +SDLK_UNDERSCORE '_' underscore +SDLK_BACKQUOTE '`' grave +SDLK_a 'a' a +SDLK_b 'b' b +SDLK_c 'c' c +SDLK_d 'd' d +SDLK_e 'e' e +SDLK_f 'f' f +SDLK_g 'g' g +SDLK_h 'h' h +SDLK_i 'i' i +SDLK_j 'j' j +SDLK_k 'k' k +SDLK_l 'l' l +SDLK_m 'm' m +SDLK_n 'n' n +SDLK_o 'o' o +SDLK_p 'p' p +SDLK_q 'q' q +SDLK_r 'r' r +SDLK_s 's' s +SDLK_t 't' t +SDLK_u 'u' u +SDLK_v 'v' v +SDLK_w 'w' w +SDLK_x 'x' x +SDLK_y 'y' y +SDLK_z 'z' z +SDLK_DELETE '^?' delete +SDLK_KP0 keypad 0 +SDLK_KP1 keypad 1 +SDLK_KP2 keypad 2 +SDLK_KP3 keypad 3 +SDLK_KP4 keypad 4 +SDLK_KP5 keypad 5 +SDLK_KP6 keypad 6 +SDLK_KP7 keypad 7 +SDLK_KP8 keypad 8 +SDLK_KP9 keypad 9 +SDLK_KP_PERIOD '.' keypad period +SDLK_KP_DIVIDE '/' keypad divide +SDLK_KP_MULTIPLY '*' keypad multiply +SDLK_KP_MINUS '-' keypad minus +SDLK_KP_PLUS '+' keypad plus +SDLK_KP_ENTER '\\r' keypad enter +SDLK_KP_EQUALS '=' keypad equals +SDLK_UP up arrow +SDLK_DOWN down arrow +SDLK_RIGHT right arrow +SDLK_LEFT left arrow +SDLK_INSERT insert +SDLK_HOME home +SDLK_END end +SDLK_PAGEUP page up +SDLK_PAGEDOWN page down +SDLK_F1 F1 +SDLK_F2 F2 +SDLK_F3 F3 +SDLK_F4 F4 +SDLK_F5 F5 +SDLK_F6 F6 +SDLK_F7 F7 +SDLK_F8 F8 +SDLK_F9 F9 +SDLK_F10 F10 +SDLK_F11 F11 +SDLK_F12 F12 +SDLK_F13 F13 +SDLK_F14 F14 +SDLK_F15 F15 +SDLK_NUMLOCK numlock +SDLK_CAPSLOCK capslock +SDLK_SCROLLOCK scrollock +SDLK_RSHIFT right shift +SDLK_LSHIFT left shift +SDLK_RCTRL right ctrl +SDLK_LCTRL left ctrl +SDLK_RALT right alt +SDLK_LALT left alt +SDLK_RMETA right meta +SDLK_LMETA left meta +SDLK_LSUPER left windows key +SDLK_RSUPER right windows key +SDLK_MODE mode shift +SDLK_HELP help +SDLK_PRINT print-screen +SDLK_SYSREQ SysRq +SDLK_BREAK break +SDLK_MENU menu +SDLK_POWER power +SDLK_EURO euro\fR +.fi + + +.SH "SDL modifier definitions" +.PP +\fBSDL Modifier Meaning\fR +.nf +\f(CWKMOD_NONE No modifiers applicable +KMOD_NUM Numlock is down +KMOD_CAPS Capslock is down +KMOD_LCTRL Left Control is down +KMOD_RCTRL Right Control is down +KMOD_RSHIFT Right Shift is down +KMOD_LSHIFT Left Shift is down +KMOD_RALT Right Alt is down +KMOD_LALT Left Alt is down +KMOD_CTRL A Control key is down +KMOD_SHIFT A Shift key is down +KMOD_ALT An Alt key is down\fR +.fi + diff --git a/docs/man3/SDL_ActiveEvent.3 b/docs/man3/SDL_ActiveEvent.3 new file mode 100644 index 0000000..068e7c0 --- /dev/null +++ b/docs/man3/SDL_ActiveEvent.3 @@ -0,0 +1,38 @@ +.TH "SDL_ActiveEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_ActiveEvent \- Application visibility event structure +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct{ + Uint8 type; + Uint8 gain; + Uint8 state; +} SDL_ActiveEvent;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBtype\fR +\fBSDL_ACTIVEEVENT\&.\fP +.TP 20 +\fBgain\fR +0 if the event is a loss or 1 if it is a gain\&. +.TP 20 +\fBstate\fR +\fBSDL_APPMOUSEFOCUS\fP if mouse focus was gained or lost, \fBSDL_APPINPUTFOCUS\fP if input focus was gained or lost, or \fBSDL_APPACTIVE\fP if the application was iconified (\fBgain\fR=0) or restored(\fBgain\fR=1)\&. +.SH "DESCRIPTION" +.PP +\fBSDL_ActiveEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_ACTIVEEVENT\fP is reported\&. +.PP +When the mouse leaves or enters the window area a \fBSDL_APPMOUSEFOCUS\fP type activation event occurs, if the mouse entered the window then \fBgain\fR will be 1, otherwise \fBgain\fR will be 0\&. A \fBSDL_APPINPUTFOCUS\fP type activation event occurs when the application loses or gains keyboard focus\&. This usually occurs when another application is made active\&. Finally, a \fBSDL_APPACTIVE\fP type event occurs when the application is either minimised/iconified (\fBgain\fR=0) or restored\&. +.PP +.RS +\fBNote: +.PP +This event does not occur when an application window is first created\&. +.RE +.SH "SEE ALSO" +.PP +\fI\fBSDL_Event\fR\fR, \fI\fBSDL_GetAppState\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_AddTimer.3 b/docs/man3/SDL_AddTimer.3 new file mode 100644 index 0000000..bc494ed --- /dev/null +++ b/docs/man3/SDL_AddTimer.3 @@ -0,0 +1,38 @@ +.TH "SDL_AddTimer" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_AddTimer \- Add a timer which will call a callback after the specified number of milliseconds has elapsed\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBSDL_TimerID \fBSDL_AddTimer\fP\fR(\fBUint32 interval, SDL_NewTimerCallback callback, void *param\fR); +.SH "CALLBACK" +.PP +.nf +\f(CW/* type definition for the "new" timer callback function */ +typedef Uint32 (*SDL_NewTimerCallback)(Uint32 interval, void *param);\fR +.fi +.PP +.SH "DESCRIPTION" +.PP +Adds a callback function to be run after the specified number of milliseconds has elapsed\&. The callback function is passed the current timer interval and the user supplied parameter from the \fBSDL_AddTimer\fP call and returns the next timer interval\&. If the returned value from the callback is the same as the one passed in, the periodic alarm continues, otherwise a new alarm is scheduled\&. +.PP +To cancel a currently running timer call \fISDL_RemoveTimer\fR with the timer ID returned from \fBSDL_AddTimer\fP\&. +.PP +The timer callback function may run in a different thread than your main program, and so shouldn\&'t call any functions from within itself\&. You may always call \fISDL_PushEvent\fR, however\&. +.PP +The granularity of the timer is platform-dependent, but you should count on it being at least 10 ms as this is the most common number\&. This means that if you request a 16 ms timer, your callback will run approximately 20 ms later on an unloaded system\&. If you wanted to set a flag signaling a frame update at 30 frames per second (every 33 ms), you might set a timer for 30 ms (see example below)\&. If you use this function, you need to pass \fBSDL_INIT_TIMER\fP to \fISDL_Init\fR\&. +.SH "RETURN VALUE" +.PP +Returns an ID value for the added timer or \fBNULL\fR if there was an error\&. +.SH "EXAMPLES" +.PP +.PP +.nf +\f(CWmy_timer_id = SDL_AddTimer((33/10)*10, my_callbackfunc, my_callback_param);\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_RemoveTimer\fP\fR, \fI\fBSDL_PushEvent\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_AudioCVT.3 b/docs/man3/SDL_AudioCVT.3 new file mode 100644 index 0000000..f5e3489 --- /dev/null +++ b/docs/man3/SDL_AudioCVT.3 @@ -0,0 +1,68 @@ +.TH "SDL_AudioCVT" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_AudioCVT \- Audio Conversion Structure +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct{ + int needed; + Uint16 src_format; + Uint16 dest_format; + double rate_incr; + Uint8 *buf; + int len; + int len_cvt; + int len_mult; + double len_ratio; + void (*filters[10])(struct SDL_AudioCVT *cvt, Uint16 format); + int filter_index; +} SDL_AudioCVT;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBneeded\fR +Set to one if the conversion is possible +.TP 20 +\fBsrc_format\fR +Audio format of the source +.TP 20 +\fBdest_format\fR +Audio format of the destination +.TP 20 +\fBrate_incr\fR +Rate conversion increment +.TP 20 +\fBbuf\fR +Audio buffer +.TP 20 +\fBlen\fR +Length of the original audio buffer in bytes +.TP 20 +\fBlen_cvt\fR +Length of converted audio buffer in bytes (calculated) +.TP 20 +\fBlen_mult\fR +\fBbuf\fR must be \fBlen\fR*\fBlen_mult\fR bytes in size(calculated) +.TP 20 +\fBlen_ratio\fR +Final audio size is \fBlen\fR*\fBlen_ratio\fR +.TP 20 +\fBfilters[10](\&.\&.)\fR +Pointers to functions needed for this conversion +.TP 20 +\fBfilter_index\fR +Current conversion function +.SH "DESCRIPTION" +.PP +The \fBSDL_AudioCVT\fR is used to convert audio data between different formats\&. A \fBSDL_AudioCVT\fR structure is created with the \fI\fBSDL_BuildAudioCVT\fP\fR function, while the actual conversion is done by the \fI\fBSDL_ConvertAudio\fP\fR function\&. +.PP +Many of the fields in the \fBSDL_AudioCVT\fR structure should be considered private and their function will not be discussed here\&. +.IP "\fBUint8 *\fP\fBbuf\fR" 10This points to the audio data that will be used in the conversion\&. It is both the source and the destination, which means the converted audio data overwrites the original data\&. It also means that the converted data may be larger than the original data (if you were converting from 8-bit to 16-bit, for instance), so you must ensure \fBbuf\fR is large enough\&. See below\&. +.IP "\fBint\fP \fBlen\fR" 10This is the length of the original audio data in bytes\&. +.IP "\fBint\fP \fBlen_mult\fR" 10As explained above, the audio buffer needs to be big enough to store the converted data, which may be bigger than the original audio data\&. The length of \fBbuf\fR should be \fBlen\fR*\fBlen_mult\fR\&. +.IP "\fBdouble\fP \fBlen_ratio\fR" 10When you have finished converting your audio data, you need to know how much of your audio buffer is valid\&. \fBlen\fR*\fBlen_ratio\fR is the size of the converted audio data in bytes\&. This is very similar to \fBlen_mult\fR, however when the convert audio data is shorter than the original \fBlen_mult\fR would be 1\&. \fBlen_ratio\fR, on the other hand, would be a fractional number between 0 and 1\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_BuildAudioCVT\fP\fR, \fI\fBSDL_ConvertAudio\fP\fR, \fI\fBSDL_AudioSpec\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_AudioSpec.3 b/docs/man3/SDL_AudioSpec.3 new file mode 100644 index 0000000..c70ffd1 --- /dev/null +++ b/docs/man3/SDL_AudioSpec.3 @@ -0,0 +1,70 @@ +.TH "SDL_AudioSpec" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_AudioSpec \- Audio Specification Structure +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct{ + int freq; + Uint16 format; + Uint8 channels; + Uint8 silence; + Uint16 samples; + Uint32 size; + void (*callback)(void *userdata, Uint8 *stream, int len); + void *userdata; +} SDL_AudioSpec;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBfreq\fR +Audio frequency in samples per second +.TP 20 +\fBformat\fR +Audio data format +.TP 20 +\fBchannels\fR +Number of channels: 1 mono, 2 stereo +.TP 20 +\fBsilence\fR +Audio buffer silence value (calculated) +.TP 20 +\fBsamples\fR +Audio buffer size in samples +.TP 20 +\fBsize\fR +Audio buffer size in bytes (calculated) +.TP 20 +\fBcallback(\&.\&.)\fR +Callback function for filling the audio buffer +.TP 20 +\fBuserdata\fR +Pointer the user data which is passed to the callback function +.SH "DESCRIPTION" +.PP +The \fBSDL_AudioSpec\fR structure is used to describe the format of some audio data\&. This structure is used by \fI\fBSDL_OpenAudio\fP\fR and \fI\fBSDL_LoadWAV\fP\fR\&. While all fields are used by \fBSDL_OpenAudio\fP only \fBfreq\fR, \fBformat\fR, \fBsamples\fR and \fBchannels\fR are used by \fBSDL_LoadWAV\fP\&. We will detail these common members here\&. +.TP 20 +\fBfreq\fR +The number of samples sent to the sound device every second\&. Common values are 11025, 22050 and 44100\&. The higher the better\&. +.TP 20 +\fBformat\fR +Specifies the size and type of each sample element +.IP "\fBAUDIO_U8\fP" 10Unsigned 8-bit samples +.IP "\fBAUDIO_S8\fP" 10Signed 8-bit samples +.IP "\fBAUDIO_U16\fP or \fBAUDIO_U16LSB\fP" 10Unsigned 16-bit little-endian samples +.IP "\fBAUDIO_S16\fP or \fBAUDIO_S16LSB\fP" 10Signed 16-bit little-endian samples +.IP "\fBAUDIO_U16MSB\fP" 10Unsigned 16-bit big-endian samples +.IP "\fBAUDIO_S16MSB\fP" 10Signed 16-bit big-endian samples +.IP "\fBAUDIO_U16SYS\fP" 10Either \fBAUDIO_U16LSB\fP or \fBAUDIO_U16MSB\fP depending on you systems endianness +.IP "\fBAUDIO_S16SYS\fP" 10Either \fBAUDIO_S16LSB\fP or \fBAUDIO_S16MSB\fP depending on you systems endianness +.TP 20 +\fBchannels\fR +The number of seperate sound channels\&. 1 is mono (single channel), 2 is stereo (dual channel)\&. +.TP 20 +\fBsamples\fR +When used with \fI\fBSDL_OpenAudio\fP\fR this refers to the size of the audio buffer in samples\&. A sample a chunk of audio data of the size specified in \fBformat\fR mulitplied by the number of channels\&. When the \fBSDL_AudioSpec\fR is used with \fI\fBSDL_LoadWAV\fP\fR \fBsamples\fR is set to 4096\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_OpenAudio\fP\fR, \fI\fBSDL_LoadWAV\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_BlitSurface.3 b/docs/man3/SDL_BlitSurface.3 new file mode 100644 index 0000000..5f62ffb --- /dev/null +++ b/docs/man3/SDL_BlitSurface.3 @@ -0,0 +1,60 @@ +.TH "SDL_BlitSurface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_BlitSurface \- This performs a fast blit from the source surface to the destination surface\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_BlitSurface\fP\fR(\fBSDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect\fR); +.SH "DESCRIPTION" +.PP +This performs a fast blit from the source surface to the destination surface\&. +.PP +Only the position is used in the \fBdstrect\fR (the width and height are ignored)\&. +.PP +If either \fBsrcrect\fR or \fBdstrect\fR are \fBNULL\fP, the entire surface (\fBsrc\fR or \fBdst\fR) is copied\&. +.PP +The final blit rectangle is saved in \fBdstrect\fR after all clipping is performed (\fBsrcrect\fR is not modified)\&. +.PP +The blit function should not be called on a locked surface\&. +.PP +The results of blitting operations vary greatly depending on whether \fBSDL_SRCAPLHA\fP is set or not\&. See \fISDL_SetAlpha\fR for an explaination of how this affects your results\&. Colorkeying and alpha attributes also interact with surface blitting, as the following pseudo-code should hopefully explain\&. +.PP +.nf +\f(CWif (source surface has SDL_SRCALPHA set) { + if (source surface has alpha channel (that is, format->Amask != 0)) + blit using per-pixel alpha, ignoring any colour key + else { + if (source surface has SDL_SRCCOLORKEY set) + blit using the colour key AND the per-surface alpha value + else + blit using the per-surface alpha value + } +} else { + if (source surface has SDL_SRCCOLORKEY set) + blit using the colour key + else + ordinary opaque rectangular blit +}\fR +.fi +.PP +.SH "RETURN VALUE" +.PP +If the blit is successful, it returns \fB0\fR, otherwise it returns \fB-1\fR\&. +.PP +If either of the surfaces were in video memory, and the blit returns \fB-2\fR, the video memory was lost, so it should be reloaded with artwork and re-blitted: +.PP +.nf +\f(CW while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) { + while ( SDL_LockSurface(image)) < 0 ) + Sleep(10); + -- Write image pixels to image->pixels -- + SDL_UnlockSurface(image); + }\fR +.fi +.PP + This happens under DirectX 5\&.0 when the system switches away from your fullscreen application\&. Locking the surface will also fail until you have access to the video memory again\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_LockSurface\fP\fR, \fI\fBSDL_FillRect\fP\fR, \fI\fBSDL_Surface\fR\fR, \fI\fBSDL_Rect\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_BuildAudioCVT.3 b/docs/man3/SDL_BuildAudioCVT.3 new file mode 100644 index 0000000..dfca664 --- /dev/null +++ b/docs/man3/SDL_BuildAudioCVT.3 @@ -0,0 +1,23 @@ +.TH "SDL_BuildAudioCVT" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_BuildAudioCVT \- Initializes a SDL_AudioCVT structure for conversion +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_BuildAudioCVT\fP\fR(\fBSDL_AudioCVT *cvt, Uint16 src_format, Uint8 src_channels, int src_rate, Uint16 dst_format, Uint8 dst_channels, int dst_rate\fR); +.SH "DESCRIPTION" +.PP +Before an \fI\fBSDL_AudioCVT\fR\fR structure can be used to convert audio data it must be initialized with source and destination information\&. +.PP +\fBsrc_format\fR and \fBdst_format\fR are the source and destination format of the conversion\&. (For information on audio formats see \fI\fB SDL_AudioSpec\fR\fR)\&. \fBsrc_channels\fR and \fBdst_channels\fR are the number of channels in the source and destination formats\&. Finally, \fBsrc_rate\fR and \fBdst_rate\fR are the frequency or samples-per-second of the source and destination formats\&. Once again, see \fI\fBSDL_AudioSpec\fR\fR\&. +.SH "RETURN VALUES" +.PP +Returns \fB-1\fR if the filter could not be built or 1 if it could\&. +.SH "EXAMPLES" +.PP +See \fI\fBSDL_ConvertAudio\fP\fR\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_ConvertAudio\fP\fR, \fI\fBSDL_AudioCVT\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CD.3 b/docs/man3/SDL_CD.3 new file mode 100644 index 0000000..ea21818 --- /dev/null +++ b/docs/man3/SDL_CD.3 @@ -0,0 +1,57 @@ +.TH "SDL_CD" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CD \- CDROM Drive Information +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct{ + int id; + CDstatus status; + int numtracks; + int cur_track; + int cur_frame; + SDL_CDtrack track[SDL_MAX_TRACKS+1]; +} SDL_CD;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBid\fR +Private drive identifier +.TP 20 +\fBstatus\fR +Drive \fIstatus\fR +.TP 20 +\fBnumtracks\fR +Number of tracks on the CD +.TP 20 +\fBcur_track\fR +Current track +.TP 20 +\fBcur_frame\fR +Current frame offset within the track +.TP 20 +\fBtrack\fR[SDL_MAX_TRACKS+1] +Array of track descriptions\&. (see \fI\fBSDL_CDtrack\fR\fR) +.SH "DESCRIPTION" +.PP +An \fBSDL_CD\fR structure is returned by \fI\fBSDL_CDOpen\fP\fR\&. It represents an opened CDROM device and stores information on the layout of the tracks on the disc\&. +.PP +A frame is the base data unit of a CD\&. \fBCD_FPS\fP frames is equal to 1 second of music\&. SDL provides two macros for converting between time and frames: \fBFRAMES_TO_MSF(f, M,S,F)\fP and \fBMSF_TO_FRAMES\fP\&. +.SH "EXAMPLES" +.PP +.nf +\f(CWint min, sec, frame; +int frame_offset; + +FRAMES_TO_MSF(cdrom->cur_frame, &min, &sec, &frame); +printf("Current Position: %d minutes, %d seconds, %d frames +", min, sec, frame); + +frame_offset=MSF_TO_FRAMES(min, sec, frame);\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_CDOpen\fP\fR, \fI\fBSDL_CDtrack\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CDClose.3 b/docs/man3/SDL_CDClose.3 new file mode 100644 index 0000000..9dd29fb --- /dev/null +++ b/docs/man3/SDL_CDClose.3 @@ -0,0 +1,15 @@ +.TH "SDL_CDClose" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CDClose \- Closes a SDL_CD handle +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_CDClose\fP\fR(\fBSDL_CD *cdrom\fR); +.SH "DESCRIPTION" +.PP +Closes the given \fBcdrom\fR handle\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_CDOpen\fP\fR, \fI\fBSDL_CD\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CDEject.3 b/docs/man3/SDL_CDEject.3 new file mode 100644 index 0000000..2f2983d --- /dev/null +++ b/docs/man3/SDL_CDEject.3 @@ -0,0 +1,18 @@ +.TH "SDL_CDEject" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CDEject \- Ejects a CDROM +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_CDEject\fP\fR(\fBSDL_CD *cdrom\fR); +.SH "DESCRIPTION" +.PP +Ejects the given \fBcdrom\fR\&. +.SH "RETURN VALUE" +.PP +Returns \fB0\fR on success, or \fB-1\fR on an error\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_CD\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CDName.3 b/docs/man3/SDL_CDName.3 new file mode 100644 index 0000000..c6f6298 --- /dev/null +++ b/docs/man3/SDL_CDName.3 @@ -0,0 +1,23 @@ +.TH "SDL_CDName" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CDName \- Returns a human-readable, system-dependent identifier for the CD-ROM\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBconst char *\fBSDL_CDName\fP\fR(\fBint drive\fR); +.SH "DESCRIPTION" +.PP +Returns a human-readable, system-dependent identifier for the CD-ROM\&. \fBdrive\fR is the index of the drive\&. Drive indices start to 0 and end at \fBSDL_CDNumDrives()\fP-1\&. +.SH "EXAMPLES" +.PP +.IP " \(bu" 6 +"/dev/cdrom" +.IP " \(bu" 6 +"E:" +.IP " \(bu" 6 +"/dev/disk/ide/1/master" +.SH "SEE ALSO" +.PP +\fI\fBSDL_CDNumDrives\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CDNumDrives.3 b/docs/man3/SDL_CDNumDrives.3 new file mode 100644 index 0000000..ad62b68 --- /dev/null +++ b/docs/man3/SDL_CDNumDrives.3 @@ -0,0 +1,15 @@ +.TH "SDL_CDNumDrives" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CDNumDrives \- Returns the number of CD-ROM drives on the system\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_CDNumDrives\fP\fR(\fBvoid\fR) +.SH "DESCRIPTION" +.PP +Returns the number of CD-ROM drives on the system\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_CDOpen\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CDOpen.3 b/docs/man3/SDL_CDOpen.3 new file mode 100644 index 0000000..dbf23fc --- /dev/null +++ b/docs/man3/SDL_CDOpen.3 @@ -0,0 +1,58 @@ +.TH "SDL_CDOpen" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CDOpen \- Opens a CD-ROM drive for access\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBSDL_CD *\fBSDL_CDOpen\fP\fR(\fBint drive\fR); +.SH "DESCRIPTION" +.PP +Opens a CD-ROM drive for access\&. It returns a \fI\fBSDL_CD\fR\fR structure on success, or \fBNULL\fP if the drive was invalid or busy\&. This newly opened CD-ROM becomes the default CD used when other CD functions are passed a \fBNULL\fP CD-ROM handle\&. +.PP +Drives are numbered starting with 0\&. Drive 0 is the system default CD-ROM\&. +.SH "EXAMPLES" +.PP +.nf +\f(CWSDL_CD *cdrom; +int cur_track; +int min, sec, frame; +SDL_Init(SDL_INIT_CDROM); +atexit(SDL_Quit); + +/* Check for CD drives */ +if(!SDL_CDNumDrives()){ + /* None found */ + fprintf(stderr, "No CDROM devices available +"); + exit(-1); +} + +/* Open the default drive */ +cdrom=SDL_CDOpen(0); + +/* Did if open? Check if cdrom is NULL */ +if(!cdrom){ + fprintf(stderr, "Couldn\&'t open drive: %s +", SDL_GetError()); + exit(-1); +} + +/* Print Volume info */ +printf("Name: %s +", SDL_CDName(0)); +printf("Tracks: %d +", cdrom->numtracks); +for(cur_track=0;cur_track < cdrom->numtracks; cur_track++){ + FRAMES_TO_MSF(cdrom->track[cur_track]\&.length, &min, &sec, &frame); + printf(" Track %d: Length %d:%d +", cur_track, min, sec); +} + +SDL_CDClose(cdrom);\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_CD\fR\fR, \fI\fBSDL_CDtrack\fR\fR, \fI\fBSDL_CDClose\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CDPause.3 b/docs/man3/SDL_CDPause.3 new file mode 100644 index 0000000..bca06c0 --- /dev/null +++ b/docs/man3/SDL_CDPause.3 @@ -0,0 +1,18 @@ +.TH "SDL_CDPause" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CDPause \- Pauses a CDROM +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_CDPause\fP\fR(\fBSDL_CD *cdrom\fR); +.SH "DESCRIPTION" +.PP +Pauses play on the given \fBcdrom\fR\&. +.SH "RETURN VALUE" +.PP +Returns \fB0\fR on success, or \fB-1\fR on an error\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_CDPlay\fP\fR, \fI\fBSDL_CDResume\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CDPlay.3 b/docs/man3/SDL_CDPlay.3 new file mode 100644 index 0000000..39c25ec --- /dev/null +++ b/docs/man3/SDL_CDPlay.3 @@ -0,0 +1,18 @@ +.TH "SDL_CDPlay" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CDPlay \- Play a CD +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_CDPlay\fP\fR(\fBSDL_CD *cdrom, int start, int length\fR); +.SH "DESCRIPTION" +.PP +Plays the given \fBcdrom\fR, starting a frame \fBstart\fR for \fBlength\fR frames\&. +.SH "RETURN VALUES" +.PP +Returns \fB0\fR on success, or \fB-1\fR on an error\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_CDPlayTracks\fP\fR, \fI\fBSDL_CDStop\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CDPlayTracks.3 b/docs/man3/SDL_CDPlayTracks.3 new file mode 100644 index 0000000..5a403b3 --- /dev/null +++ b/docs/man3/SDL_CDPlayTracks.3 @@ -0,0 +1,47 @@ +.TH "SDL_CDPlayTracks" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CDPlayTracks \- Play the given CD track(s) +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_CDPlayTracks\fP\fR(\fBSDL_CD *cdrom, int start_track, int start_frame, int ntracks, int nframes)\fR); +.SH "DESCRIPTION" +.PP +\fBSDL_CDPlayTracks\fP plays the given CD starting at track \fBstart_track\fR, for \fBntracks\fR tracks\&. +.PP +\fBstart_frame\fR is the frame offset, from the beginning of the \fBstart_track\fR, at which to start\&. \fBnframes\fR is the frame offset, from the beginning of the last track (\fBstart_track\fR+\fBntracks\fR), at which to end playing\&. +.PP +\fBSDL_CDPlayTracks\fP should only be called after calling \fI\fBSDL_CDStatus\fP\fR to get track information about the CD\&. +.PP +.RS +\fBNote: +.PP +Data tracks are ignored\&. +.RE +.SH "RETURN VALUE" +.PP +Returns \fB0\fR, or \fB-1\fR if there was an error\&. +.SH "EXAMPLES" +.PP +.PP +.nf +\f(CW/* assuming cdrom is a previously opened device */ +/* Play the entire CD */ +if(CD_INDRIVE(SDL_CDStatus(cdrom))) + SDL_CDPlayTracks(cdrom, 0, 0, 0, 0); + +/* Play the first track */ +if(CD_INDRIVE(SDL_CDStatus(cdrom))) + SDL_CDPlayTracks(cdrom, 0, 0, 1, 0); + +/* Play first 15 seconds of the 2nd track */ +if(CD_INDRIVE(SDL_CDStatus(cdrom))) + SDL_CDPlayTracks(cdrom, 1, 0, 0, CD_FPS*15);\fR +.fi +.PP + +.SH "SEE ALSO" +.PP +\fI\fBSDL_CDPlay\fP\fR, \fI\fBSDL_CDStatus\fP\fR, \fI\fBSDL_CD\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CDResume.3 b/docs/man3/SDL_CDResume.3 new file mode 100644 index 0000000..86f6c2d --- /dev/null +++ b/docs/man3/SDL_CDResume.3 @@ -0,0 +1,18 @@ +.TH "SDL_CDResume" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CDResume \- Resumes a CDROM +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_CDResume\fP\fR(\fBSDL_CD *cdrom\fR); +.SH "DESCRIPTION" +.PP +Resumes play on the given \fBcdrom\fR\&. +.SH "RETURN VALUE" +.PP +Returns \fB0\fR on success, or \fB-1\fR on an error\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_CDPlay\fP\fR, \fI\fBSDL_CDPause\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CDStatus.3 b/docs/man3/SDL_CDStatus.3 new file mode 100644 index 0000000..77eed72 --- /dev/null +++ b/docs/man3/SDL_CDStatus.3 @@ -0,0 +1,59 @@ +.TH "SDL_CDStatus" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CDStatus \- Returns the current status of the given drive\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBCDstatus \fBSDL_CDStatus\fP\fR(\fBSDL_CD *cdrom\fR); +\fB/* Given a status, returns true if there\&'s a disk in the drive */ +#define CD_INDRIVE(status) ((int)status > 0) +.SH "DESCRIPTION" +.PP +This function returns the current status of the given drive\&. Status is described like so: +.PP +.nf +\f(CWtypedef enum { + CD_TRAYEMPTY, + CD_STOPPED, + CD_PLAYING, + CD_PAUSED, + CD_ERROR = -1 +} CDstatus;\fR +.fi +.PP +.PP +If the drive has a CD in it, the table of contents of the CD and current play position of the CD will be stored in the SDL_CD structure\&. +.PP +The macro \fBCD_INDRIVE\fP is provided for convenience, and given a status returns true if there\&'s a disk in the drive\&. +.PP +.RS +\fBNote: +.PP +\fBSDL_CDStatus\fP also updates the \fI\fBSDL_CD\fR\fR structure passed to it\&. +.RE +.SH "EXAMPLE" +.PP +.nf +\f(CWint playTrack(int track) +{ + int playing = 0; + + if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) { + /* clamp to the actual number of tracks on the CD */ + if (track >= cdrom->numtracks) { + track = cdrom->numtracks-1; + } + + if ( SDL_CDPlayTracks(cdrom, track, 0, 1, 0) == 0 ) { + playing = 1; + } + } + return playing; +}\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_CD\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CDStop.3 b/docs/man3/SDL_CDStop.3 new file mode 100644 index 0000000..61e2b23 --- /dev/null +++ b/docs/man3/SDL_CDStop.3 @@ -0,0 +1,18 @@ +.TH "SDL_CDStop" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CDStop \- Stops a CDROM +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_CDStop\fP\fR(\fBSDL_CD *cdrom\fR); +.SH "DESCRIPTION" +.PP +Stops play on the given \fBcdrom\fR\&. +.SH "RETURN VALUE" +.PP +Returns \fB0\fR on success, or \fB-1\fR on an error\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_CDPlay\fP\fR, +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_CDtrack.3 b/docs/man3/SDL_CDtrack.3 new file mode 100644 index 0000000..fdac6ee --- /dev/null +++ b/docs/man3/SDL_CDtrack.3 @@ -0,0 +1,40 @@ +.TH "SDL_CDtrack" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CDtrack \- CD Track Information Structure +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct{ + Uint8 id; + Uint8 type; + Uint32 length; + Uint32 offset; +} SDL_CDtrack;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBid\fR +Track number (0-99) +.TP 20 +\fBtype\fR +\fBSDL_AUDIO_TRACK\fP or \fBSDL_DATA_TRACK\fP +.TP 20 +\fBlength\fR +Length, in frames, of this track +.TP 20 +\fBoffset\fR +Frame offset to the beginning of this track +.SH "DESCRIPTION" +.PP +\fBSDL_CDtrack\fR stores data on each track on a CD, its fields should be pretty self explainatory\&. It is a member a the \fI\fBSDL_CD\fR\fR structure\&. +.PP +.RS +\fBNote: +.PP +Frames can be converted to standard timings\&. There are \fBCD_FPS\fP frames per second, so \fBSDL_CDtrack\fR\&.\fBlength\fR/\fBCD_FPS\fP=length_in_seconds\&. +.RE +.SH "SEE ALSO" +.PP +\fI\fBSDL_CD\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_CloseAudio.3 b/docs/man3/SDL_CloseAudio.3 new file mode 100644 index 0000000..85ff1a4 --- /dev/null +++ b/docs/man3/SDL_CloseAudio.3 @@ -0,0 +1,15 @@ +.TH "SDL_CloseAudio" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CloseAudio \- Shuts down audio processing and closes the audio device\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_CloseAudio\fP\fR(\fBvoid\fR) +.SH "DESCRIPTION" +.PP +This function shuts down audio processing and closes the audio device\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_OpenAudio\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_Color.3 b/docs/man3/SDL_Color.3 new file mode 100644 index 0000000..e96ee8a --- /dev/null +++ b/docs/man3/SDL_Color.3 @@ -0,0 +1,34 @@ +.TH "SDL_Color" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_Color \- Format independent color description +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct{ + Uint8 r; + Uint8 g; + Uint8 b; + Uint8 unused; +} SDL_Color;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBr\fR +Red intensity +.TP 20 +\fBg\fR +Green intensity +.TP 20 +\fBb\fR +Blue intensity +.TP 20 +\fBunused\fR +Unused +.SH "DESCRIPTION" +.PP +\fBSDL_Color\fR describes a color in a format independent way\&. You can convert a \fBSDL_Color\fR to a pixel value for a certain pixel format using \fI\fBSDL_MapRGB\fP\fR\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_PixelFormat\fR\fR, \fI\fBSDL_SetColors\fP\fR, \fI\fBSDL_Palette\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_CondBroadcast.3 b/docs/man3/SDL_CondBroadcast.3 new file mode 100644 index 0000000..efc50b9 --- /dev/null +++ b/docs/man3/SDL_CondBroadcast.3 @@ -0,0 +1,16 @@ +.TH "SDL_CondBroadcast" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CondBroadcast \- Restart all threads waiting on a condition variable +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +#include "SDL_thread\&.h" +.sp +\fBint \fBSDL_CondBroadcast\fP\fR(\fBSDL_cond *cond\fR); +.SH "DESCRIPTION" +.PP +Restarts all threads that are waiting on the condition variable, \fBcond\fR\&. Returns \fB0\fR on success, or \fB-1\fR on an error\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_CondSignal\fP\fR, \fI\fBSDL_CondWait\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_CondSignal.3 b/docs/man3/SDL_CondSignal.3 new file mode 100644 index 0000000..b09c875 --- /dev/null +++ b/docs/man3/SDL_CondSignal.3 @@ -0,0 +1,16 @@ +.TH "SDL_CondSignal" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CondSignal \- Restart a thread wait on a condition variable +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +#include "SDL_thread\&.h" +.sp +\fBint \fBSDL_CondSignal\fP\fR(\fBSDL_cond *cond\fR); +.SH "DESCRIPTION" +.PP +Restart one of the threads that are waiting on the condition variable, \fBcond\fR\&. Returns \fB0\fR on success of \fB-1\fR on an error\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_CondWait\fP\fR, \fI\fBSDL_CondBroadcast\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_CondWait.3 b/docs/man3/SDL_CondWait.3 new file mode 100644 index 0000000..642f512 --- /dev/null +++ b/docs/man3/SDL_CondWait.3 @@ -0,0 +1,16 @@ +.TH "SDL_CondWait" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CondWait \- Wait on a condition variable +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +#include "SDL_thread\&.h" +.sp +\fBint \fBSDL_CondWait\fP\fR(\fBSDL_cond *cond, SDL_mutex *mut\fR); +.SH "DESCRIPTION" +.PP +Wait on the condition variable \fBcond\fR and unlock the provided mutex\&. The mutex must the locked before entering this function\&. Returns \fB0\fR when it is signalled, or \fB-1\fR on an error\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_CondWaitTimeout\fP\fR, \fI\fBSDL_CondSignal\fP\fR, \fI\fBSDL_mutexP\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_CondWaitTimeout.3 b/docs/man3/SDL_CondWaitTimeout.3 new file mode 100644 index 0000000..7b3424d --- /dev/null +++ b/docs/man3/SDL_CondWaitTimeout.3 @@ -0,0 +1,16 @@ +.TH "SDL_CondWaitTimeout" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CondWaitTimeout \- Wait on a condition variable, with timeout +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +#include "SDL_thread\&.h" +.sp +\fBint \fBSDL_CondWaitTimeout\fP\fR(\fBSDL_cond *cond, SDL_mutex *mutex, Uint32 ms\fR); +.SH "DESCRIPTION" +.PP +Wait on the condition variable \fBcond\fR for, at most, \fBms\fR milliseconds\&. \fBmut\fR is unlocked so it must be locked when the function is called\&. Returns \fBSDL_MUTEX_TIMEDOUT\fP if the condition is not signalled in the allotted time, \fB0\fR if it was signalled or \fB-1\fR on an error\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_CondWait\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_ConvertAudio.3 b/docs/man3/SDL_ConvertAudio.3 new file mode 100644 index 0000000..73ef974 --- /dev/null +++ b/docs/man3/SDL_ConvertAudio.3 @@ -0,0 +1,95 @@ +.TH "SDL_ConvertAudio" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_ConvertAudio \- Convert audio data to a desired audio format\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_ConvertAudio\fP\fR(\fBSDL_AudioCVT *cvt\fR); +.SH "DESCRIPTION" +.PP +\fBSDL_ConvertAudio\fP takes one parameter, \fBcvt\fR, which was previously initilized\&. Initilizing a \fI\fBSDL_AudioCVT\fR\fR is a two step process\&. First of all, the structure must be passed to \fI\fBSDL_BuildAudioCVT\fP\fR along with source and destination format parameters\&. Secondly, the \fBcvt\fR->\fBbuf\fR and \fBcvt\fR->\fBlen\fR fields must be setup\&. \fBcvt\fR->\fBbuf\fR should point to the audio data and \fBcvt\fR->\fBlen\fR should be set to the length of the audio data in bytes\&. Remember, the length of the buffer pointed to by \fBbuf\fR show be \fBlen\fR*\fBlen_mult\fR bytes in length\&. +.PP +Once the \fBSDL_AudioCVT\fRstructure is initilized then we can pass it to \fBSDL_ConvertAudio\fP, which will convert the audio data pointer to by \fBcvt\fR->\fBbuf\fR\&. If \fBSDL_ConvertAudio\fP returned \fB0\fR then the conversion was completed successfully, otherwise \fB-1\fR is returned\&. +.PP +If the conversion completed successfully then the converted audio data can be read from \fBcvt\fR->\fBbuf\fR\&. The amount of valid, converted, audio data in the buffer is equal to \fBcvt\fR->\fBlen\fR*\fBcvt\fR->\fBlen_ratio\fR\&. +.SH "EXAMPLES" +.PP +.nf +\f(CW/* Converting some WAV data to hardware format */ +void my_audio_callback(void *userdata, Uint8 *stream, int len); + +SDL_AudioSpec *desired, *obtained; +SDL_AudioSpec wav_spec; +SDL_AudioCVT wav_cvt; +Uint32 wav_len; +Uint8 *wav_buf; +int ret; + +/* Allocated audio specs */ +desired=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec)); +obtained=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec)); + +/* Set desired format */ +desired->freq=22050; +desired->format=AUDIO_S16LSB; +desired->samples=8192; +desired->callback=my_audio_callback; +desired->userdata=NULL; + +/* Open the audio device */ +if ( SDL_OpenAudio(desired, obtained) < 0 ){ + fprintf(stderr, "Couldn\&'t open audio: %s +", SDL_GetError()); + exit(-1); +} + +free(desired); + +/* Load the test\&.wav */ +if( SDL_LoadWAV("test\&.wav", &wav_spec, &wav_buf, &wav_len) == NULL ){ + fprintf(stderr, "Could not open test\&.wav: %s +", SDL_GetError()); + SDL_CloseAudio(); + free(obtained); + exit(-1); +} + +/* Build AudioCVT */ +ret = SDL_BuildAudioCVT(&wav_cvt, + wav_spec\&.format, wav_spec\&.channels, wav_spec\&.freq, + obtained->format, obtained->channels, obtained->freq); + +/* Check that the convert was built */ +if(ret==-1){ + fprintf(stderr, "Couldn\&'t build converter! +"); + SDL_CloseAudio(); + free(obtained); + SDL_FreeWAV(wav_buf); +} + +/* Setup for conversion */ +wav_cvt\&.buf=(Uint8 *)malloc(wav_len*wav_cvt\&.len_mult); +wav_cvt\&.len=wav_len; +memcpy(wav_cvt\&.buf, wav_buf, wav_len); + +/* We can delete to original WAV data now */ +SDL_FreeWAV(wav_buf); + +/* And now we\&'re ready to convert */ +SDL_ConvertAudio(&wav_cvt); + +/* do whatever */ +\&. +\&. +\&. +\&. + +\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_BuildAudioCVT\fP\fR, \fI\fBSDL_AudioCVT\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_ConvertSurface.3 b/docs/man3/SDL_ConvertSurface.3 new file mode 100644 index 0000000..cb24e34 --- /dev/null +++ b/docs/man3/SDL_ConvertSurface.3 @@ -0,0 +1,24 @@ +.TH "SDL_ConvertSurface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_ConvertSurface \- Converts a surface to the same format as another surface\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL/SDL\&.h" +.sp +\fBSDL_Surface *\fBSDL_ConvertSurface\fP\fR(\fBSDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags\fR); +.SH "DESCRIPTION" +.PP +Creates a new surface of the specified format, and then copies and maps the given surface to it\&. If this function fails, it returns \fBNULL\fP\&. +.PP +The \fBflags\fR parameter is passed to \fI\fBSDL_CreateRGBSurface\fP\fR and has those semantics\&. +.PP +This function is used internally by \fI\fBSDL_DisplayFormat\fP\fR\&. +.PP +This function can only be called after SDL_Init\&. +.SH "RETURN VALUE" +.PP +Returns either a pointer to the new surface, or \fBNULL\fP on error\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_CreateRGBSurface\fP\fR, \fI\fBSDL_DisplayFormat\fP\fR, \fI\fBSDL_PixelFormat\fR\fR, \fI\fBSDL_Surface\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_CreateCond.3 b/docs/man3/SDL_CreateCond.3 new file mode 100644 index 0000000..e8c2896 --- /dev/null +++ b/docs/man3/SDL_CreateCond.3 @@ -0,0 +1,31 @@ +.TH "SDL_CreateCond" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CreateCond \- Create a condition variable +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +#include "SDL_thread\&.h" +.sp +\fBSDL_cond *\fBSDL_CreateCond\fP\fR(\fBvoid\fR); +.SH "DESCRIPTION" +.PP +Creates a condition variable\&. +.SH "EXAMPLES" +.PP +.nf +\f(CWSDL_cond *cond; + +cond=SDL_CreateCond(); +\&. +\&. +/* Do stuff */ + +\&. +\&. +SDL_DestroyCond(cond);\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_DestroyCond\fP\fR, \fI\fBSDL_CondWait\fP\fR, \fI\fBSDL_CondSignal\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_CreateCursor.3 b/docs/man3/SDL_CreateCursor.3 new file mode 100644 index 0000000..ef205c3 --- /dev/null +++ b/docs/man3/SDL_CreateCursor.3 @@ -0,0 +1,120 @@ +.TH "SDL_CreateCursor" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CreateCursor \- Creates a new mouse cursor\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBSDL_Cursor *\fBSDL_CreateCursor\fP\fR(\fBUint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y\fR); +.SH "DESCRIPTION" +.PP +Create a cursor using the specified \fBdata\fR and \fBmask\fR (in MSB format)\&. The cursor width must be a multiple of 8 bits\&. +.PP +The cursor is created in black and white according to the following: +.TP 20 +\fBData / Mask\fR +\fBResulting pixel on screen\fR +.TP 20 +0 / 1 +White +.TP 20 +1 / 1 +Black +.TP 20 +0 / 0 +Transparent +.TP 20 +1 / 0 +Inverted color if possible, black if not\&. +.PP +Cursors created with this function must be freed with \fISDL_FreeCursor\fR\&. +.SH "EXAMPLE" +.PP +.nf +\f(CW/* Stolen from the mailing list */ +/* Creates a new mouse cursor from an XPM */ + + +/* XPM */ +static const char *arrow[] = { + /* width height num_colors chars_per_pixel */ + " 32 32 3 1", + /* colors */ + "X c #000000", + "\&. c #ffffff", + " c None", + /* pixels */ + "X ", + "XX ", + "X\&.X ", + "X\&.\&.X ", + "X\&.\&.\&.X ", + "X\&.\&.\&.\&.X ", + "X\&.\&.\&.\&.\&.X ", + "X\&.\&.\&.\&.\&.\&.X ", + "X\&.\&.\&.\&.\&.\&.\&.X ", + "X\&.\&.\&.\&.\&.\&.\&.\&.X ", + "X\&.\&.\&.\&.\&.XXXXX ", + "X\&.\&.X\&.\&.X ", + "X\&.X X\&.\&.X ", + "XX X\&.\&.X ", + "X X\&.\&.X ", + " X\&.\&.X ", + " X\&.\&.X ", + " X\&.\&.X ", + " XX ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "0,0" +}; + +static SDL_Cursor *init_system_cursor(const char *image[]) +{ + int i, row, col; + Uint8 data[4*32]; + Uint8 mask[4*32]; + int hot_x, hot_y; + + i = -1; + for ( row=0; row<32; ++row ) { + for ( col=0; col<32; ++col ) { + if ( col % 8 ) { + data[i] <<= 1; + mask[i] <<= 1; + } else { + ++i; + data[i] = mask[i] = 0; + } + switch (image[4+row][col]) { + case \&'X\&': + data[i] |= 0x01; + k[i] |= 0x01; + break; + case \&'\&.\&': + mask[i] |= 0x01; + break; + case \&' \&': + break; + } + } + } + sscanf(image[4+row], "%d,%d", &hot_x, &hot_y); + return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y); +}\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_FreeCursor\fP\fR, \fI\fBSDL_SetCursor\fP\fR, \fI\fBSDL_ShowCursor\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_CreateMutex.3 b/docs/man3/SDL_CreateMutex.3 new file mode 100644 index 0000000..c665e1c --- /dev/null +++ b/docs/man3/SDL_CreateMutex.3 @@ -0,0 +1,43 @@ +.TH "SDL_CreateMutex" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CreateMutex \- Create a mutex +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +#include "SDL_thread\&.h" +.sp +\fBSDL_mutex *\fBSDL_CreateMutex\fP\fR(\fBvoid\fR); +.SH "DESCRIPTION" +.PP +Create a new, unlocked mutex\&. +.SH "EXAMPLES" +.PP +.nf +\f(CWSDL_mutex *mut; + +mut=SDL_CreateMutex(); +\&. +\&. +if(SDL_mutexP(mut)==-1){ + fprintf(stderr, "Couldn\&'t lock mutex +"); + exit(-1); +} +\&. +/* Do stuff while mutex is locked */ +\&. +\&. +if(SDL_mutexV(mut)==-1){ + fprintf(stderr, "Couldn\&'t unlock mutex +"); + exit(-1); +} + +SDL_DestroyMutex(mut); +\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_mutexP\fP\fR, \fI\fBSDL_mutexV\fP\fR, \fI\fBSDL_DestroyMutex\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_CreateRGBSurface.3 b/docs/man3/SDL_CreateRGBSurface.3 new file mode 100644 index 0000000..142b7b7 --- /dev/null +++ b/docs/man3/SDL_CreateRGBSurface.3 @@ -0,0 +1,69 @@ +.TH "SDL_CreateRGBSurface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CreateRGBSurface \- Create an empty SDL_Surface +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBSDL_Surface *\fBSDL_CreateRGBSurface\fP\fR(\fBUint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask\fR); +.SH "DESCRIPTION" +.PP +Allocate an empty surface (must be called after \fISDL_SetVideoMode\fR) +.PP +If \fBdepth\fR is 8 bits an empty palette is allocated for the surface, otherwise a \&'packed-pixel\&' \fI\fBSDL_PixelFormat\fR\fR is created using the \fB[RGBA]mask\fR\&'s provided (see \fI\fBSDL_PixelFormat\fR\fR)\&. The \fBflags\fR specifies the type of surface that should be created, it is an OR\&'d combination of the following possible values\&. +.TP 20 +\fBSDL_SWSURFACE\fP +SDL will create the surface in system memory\&. This improves the performance of pixel level access, however you may not be able to take advantage of some types of hardware blitting\&. +.TP 20 +\fBSDL_HWSURFACE\fP +SDL will attempt to create the surface in video memory\&. This will allow SDL to take advantage of Video->Video blits (which are often accelerated)\&. +.TP 20 +\fBSDL_SRCCOLORKEY\fP +This flag turns on colourkeying for blits from this surface\&. If \fBSDL_HWSURFACE\fP is also specified and colourkeyed blits are hardware-accelerated, then SDL will attempt to place the surface in video memory\&. Use \fI\fBSDL_SetColorKey\fP\fR to set or clear this flag after surface creation\&. +.TP 20 +\fBSDL_SRCALPHA\fP +This flag turns on alpha-blending for blits from this surface\&. If \fBSDL_HWSURFACE\fP is also specified and alpha-blending blits are hardware-accelerated, then the surface will be placed in video memory if possible\&. Use \fI\fBSDL_SetAlpha\fP\fR to set or clear this flag after surface creation\&. +.PP +.RS +\fBNote: +.PP +If an alpha-channel is specified (that is, if \fBAmask\fR is nonzero), then the \fBSDL_SRCALPHA\fP flag is automatically set\&. You may remove this flag by calling \fI\fBSDL_SetAlpha\fP\fR after surface creation\&. +.RE +.SH "RETURN VALUE" +.PP +Returns the created surface, or \fBNULL\fR upon error\&. +.SH "EXAMPLE" +.PP +.nf +\f(CW /* Create a 32-bit surface with the bytes of each pixel in R,G,B,A order, + as expected by OpenGL for textures */ + SDL_Surface *surface; + Uint32 rmask, gmask, bmask, amask; + + /* SDL interprets each pixel as a 32-bit number, so our masks must depend + on the endianness (byte order) of the machine */ +#if SDL_BYTEORDER == SDL_BIG_ENDIAN + rmask = 0xff000000; + gmask = 0x00ff0000; + bmask = 0x0000ff00; + amask = 0x000000ff; +#else + rmask = 0x000000ff; + gmask = 0x0000ff00; + bmask = 0x00ff0000; + amask = 0xff000000; +#endif + + surface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32, + rmask, gmask, bmask, amask); + if(surface == NULL) { + fprintf(stderr, "CreateRGBSurface failed: %s +", SDL_GetError()); + exit(1); + }\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_CreateRGBSurfaceFrom\fP\fR, \fI\fBSDL_FreeSurface\fP\fR, \fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_LockSurface\fP\fR, \fI\fBSDL_PixelFormat\fR\fR, \fI\fBSDL_Surface\fR\fR \fI\fBSDL_SetAlpha\fP\fR \fI\fBSDL_SetColorKey\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_CreateRGBSurfaceFrom.3 b/docs/man3/SDL_CreateRGBSurfaceFrom.3 new file mode 100644 index 0000000..5330c1b --- /dev/null +++ b/docs/man3/SDL_CreateRGBSurfaceFrom.3 @@ -0,0 +1,22 @@ +.TH "SDL_CreateRGBSurfaceFrom" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CreateRGBSurfaceFrom \- Create an SDL_Surface from pixel data +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBSDL_Surface *\fBSDL_CreateRGBSurfaceFrom\fP\fR(\fBvoid *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask\fR); +.SH "DESCRIPTION" +.PP +Creates an SDL_Surface from the provided pixel data\&. +.PP +The data stored in \fBpixels\fR is assumed to be of the \fBdepth\fR specified in the parameter list\&. The pixel data is not copied into the \fBSDL_Surface\fR structure so it should not be freed until the surface has been freed with a called to \fISDL_FreeSurface\fR\&. \fBpitch\fR is the length of each scanline in bytes\&. +.PP +See \fI\fBSDL_CreateRGBSurface\fP\fR for a more detailed description of the other parameters\&. +.SH "RETURN VALUE" +.PP +Returns the created surface, or \fBNULL\fR upon error\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_CreateRGBSurface\fP\fR, \fI\fBSDL_FreeSurface\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_CreateSemaphore.3 b/docs/man3/SDL_CreateSemaphore.3 new file mode 100644 index 0000000..b803ead --- /dev/null +++ b/docs/man3/SDL_CreateSemaphore.3 @@ -0,0 +1,32 @@ +.TH "SDL_CreateSemaphore" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CreateSemaphore \- Creates a new semaphore and assigns an initial value to it\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +#include "SDL_thread\&.h" +.sp +\fBSDL_sem *\fBSDL_CreateSemaphore\fP\fR(\fBUint32 initial_value\fR); +.SH "DESCRIPTION" +.PP +\fBSDL_CreateSemaphore()\fP creates a new semaphore and initializes it with the value \fBinitial_value\fR\&. Each locking operation on the semaphore by \fISDL_SemWait\fR, \fISDL_SemTryWait\fR or \fISDL_SemWaitTimeout\fR will atomically decrement the semaphore value\&. The locking operation will be blocked if the semaphore value is not positive (greater than zero)\&. Each unlock operation by \fISDL_SemPost\fR will atomically increment the semaphore value\&. +.SH "RETURN VALUE" +.PP +Returns a pointer to an initialized semaphore or \fBNULL\fR if there was an error\&. +.SH "EXAMPLES" +.PP +.PP +.nf +\f(CWSDL_sem *my_sem; + +my_sem = SDL_CreateSemaphore(INITIAL_SEM_VALUE); + +if (my_sem == NULL) { + return CREATE_SEM_FAILED; +}\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_DestroySemaphore\fP\fR, \fI\fBSDL_SemWait\fP\fR, \fI\fBSDL_SemTryWait\fP\fR, \fI\fBSDL_SemWaitTimeout\fP\fR, \fI\fBSDL_SemPost\fP\fR, \fI\fBSDL_SemValue\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_CreateThread.3 b/docs/man3/SDL_CreateThread.3 new file mode 100644 index 0000000..ab9e79f --- /dev/null +++ b/docs/man3/SDL_CreateThread.3 @@ -0,0 +1,16 @@ +.TH "SDL_CreateThread" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CreateThread \- Creates a new thread of execution that shares its parent\&'s properties\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +#include "SDL_thread\&.h" +.sp +\fBSDL_Thread *\fBSDL_CreateThread\fP\fR(\fBint (*fn)(void *), void *data\fR); +.SH "DESCRIPTION" +.PP +\fBSDL_CreateThread\fP creates a new thread of execution that shares all of its parent\&'s global memory, signal handlers, file descriptors, etc, and runs the function \fBfn\fR passed the void pointer \fBdata\fR The thread quits when this function returns\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_KillThread\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_CreateYUVOverlay.3 b/docs/man3/SDL_CreateYUVOverlay.3 new file mode 100644 index 0000000..fda6bc8 --- /dev/null +++ b/docs/man3/SDL_CreateYUVOverlay.3 @@ -0,0 +1,17 @@ +.TH "SDL_CreateYUVOverlay" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_CreateYUVOverlay \- Create a YUV video overlay +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBSDL_Overlay *\fBSDL_CreateYUVOverlay\fP\fR(\fBint width, int height, Uint32 format, SDL_Surface *display\fR); +.SH "DESCRIPTION" +.PP +\fBSDL_CreateYUVOverlay\fP creates a YUV overlay of the specified \fBwidth\fR, \fBheight\fR and \fBformat\fR (see \fI\fBSDL_Overlay\fR\fR for a list of available formats), for the provided \fBdisplay\fR\&. A \fI\fBSDL_Overlay\fR\fR structure is returned\&. +.PP +The term \&'overlay\&' is a misnomer since, unless the overlay is created in hardware, the contents for the display surface underneath the area where the overlay is shown will be overwritten when the overlay is displayed\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_Overlay\fR\fR, \fI\fBSDL_DisplayYUVOverlay\fP\fR, \fI\fBSDL_FreeYUVOverlay\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_Delay.3 b/docs/man3/SDL_Delay.3 new file mode 100644 index 0000000..bfa80b1 --- /dev/null +++ b/docs/man3/SDL_Delay.3 @@ -0,0 +1,21 @@ +.TH "SDL_Delay" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_Delay \- Wait a specified number of milliseconds before returning\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_Delay\fP\fR(\fBUint32 ms\fR); +.SH "DESCRIPTION" +.PP +Wait a specified number of milliseconds before returning\&. \fBSDL_Delay\fP will wait at \fIleast\fP the specified time, but possible longer due to OS scheduling\&. +.PP +.RS +\fBNote: +.PP +Count on a delay granularity of \fIat least\fP 10 ms\&. Some platforms have shorter clock ticks but this is the most common\&. +.RE +.SH "SEE ALSO" +.PP +\fI\fBSDL_AddTimer\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_DestroyCond.3 b/docs/man3/SDL_DestroyCond.3 new file mode 100644 index 0000000..308b9d0 --- /dev/null +++ b/docs/man3/SDL_DestroyCond.3 @@ -0,0 +1,16 @@ +.TH "SDL_DestroyCond" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_DestroyCond \- Destroy a condition variable +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +#include "SDL_thread\&.h" +.sp +\fBvoid \fBSDL_DestroyCond\fP\fR(\fBSDL_cond *cond\fR); +.SH "DESCRIPTION" +.PP +Destroys a condition variable\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_CreateCond\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_DestroyMutex.3 b/docs/man3/SDL_DestroyMutex.3 new file mode 100644 index 0000000..1582e49 --- /dev/null +++ b/docs/man3/SDL_DestroyMutex.3 @@ -0,0 +1,16 @@ +.TH "SDL_DestroyMutex" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_DestroyMutex \- Destroy a mutex +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +#include "SDL_thread\&.h" +.sp +\fBvoid \fBSDL_DestroyMutex\fP\fR(\fBSDL_mutex *mutex\fR); +.SH "DESCRIPTION" +.PP +Destroy a previously \fIcreated\fR mutex\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_CreateMutex\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_DestroySemaphore.3 b/docs/man3/SDL_DestroySemaphore.3 new file mode 100644 index 0000000..892334f --- /dev/null +++ b/docs/man3/SDL_DestroySemaphore.3 @@ -0,0 +1,26 @@ +.TH "SDL_DestroySemaphore" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_DestroySemaphore \- Destroys a semaphore that was created by \fISDL_CreateSemaphore\fR\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +#include "SDL_thread\&.h" +.sp +\fBvoid \fBSDL_DestroySemaphore\fP\fR(\fBSDL_sem *sem\fR); +.SH "DESCRIPTION" +.PP +\fBSDL_DestroySemaphore\fP destroys the semaphore pointed to by \fBsem\fR that was created by \fI\fBSDL_CreateSemaphore\fP\fR\&. It is not safe to destroy a semaphore if there are threads currently blocked waiting on it\&. +.SH "EXAMPLES" +.PP +.PP +.nf +\f(CWif (my_sem != NULL) { + SDL_DestroySemaphore(my_sem); + my_sem = NULL; +}\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_CreateSemaphore\fP\fR, \fI\fBSDL_SemWait\fP\fR, \fI\fBSDL_SemTryWait\fP\fR, \fI\fBSDL_SemWaitTimeout\fP\fR, \fI\fBSDL_SemPost\fP\fR, \fI\fBSDL_SemValue\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_DisplayFormat.3 b/docs/man3/SDL_DisplayFormat.3 new file mode 100644 index 0000000..ca16e2a --- /dev/null +++ b/docs/man3/SDL_DisplayFormat.3 @@ -0,0 +1,22 @@ +.TH "SDL_DisplayFormat" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_DisplayFormat \- Convert a surface to the display format +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBSDL_Surface *\fBSDL_DisplayFormat\fP\fR(\fBSDL_Surface *surface\fR); +.SH "DESCRIPTION" +.PP +This function takes a surface and copies it to a new surface of the pixel format and colors of the video framebuffer, suitable for fast blitting onto the display surface\&. It calls \fISDL_ConvertSurface\fR +.PP +If you want to take advantage of hardware colorkey or alpha blit acceleration, you should set the colorkey and alpha value before calling this function\&. +.PP +If you want an alpha channel, see \fISDL_DisplayFormatAlpha\fR\&. +.SH "RETURN VALUE" +.PP +If the conversion fails or runs out of memory, it returns \fBNULL\fR +.SH "SEE ALSO" +.PP +\fI\fBSDL_ConvertSurface\fP\fR, \fI\fBSDL_DisplayFormatAlpha\fP\fR \fI\fBSDL_SetAlpha\fP\fR, \fI\fBSDL_SetColorKey\fP\fR, \fI\fBSDL_Surface\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_DisplayFormatAlpha.3 b/docs/man3/SDL_DisplayFormatAlpha.3 new file mode 100644 index 0000000..a87ddd5 --- /dev/null +++ b/docs/man3/SDL_DisplayFormatAlpha.3 @@ -0,0 +1,22 @@ +.TH "SDL_DisplayFormatAlpha" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_DisplayFormatAlpha \- Convert a surface to the display format +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBSDL_Surface *\fBSDL_DisplayFormatAlpha\fP\fR(\fBSDL_Surface *surface\fR); +.SH "DESCRIPTION" +.PP +This function takes a surface and copies it to a new surface of the pixel format and colors of the video framebuffer plus an alpha channel, suitable for fast blitting onto the display surface\&. It calls \fISDL_ConvertSurface\fR +.PP +If you want to take advantage of hardware colorkey or alpha blit acceleration, you should set the colorkey and alpha value before calling this function\&. +.PP +This function can be used to convert a colourkey to an alpha channel, if the \fBSDL_SRCCOLORKEY\fP flag is set on the surface\&. The generated surface will then be transparent (alpha=0) where the pixels match the colourkey, and opaque (alpha=255) elsewhere\&. +.SH "RETURN VALUE" +.PP +If the conversion fails or runs out of memory, it returns \fBNULL\fR +.SH "SEE ALSO" +.PP +\fISDL_ConvertSurface\fR, \fISDL_SetAlpha\fR, \fISDL_SetColorKey\fR, \fISDL_DisplayFormat\fR, \fISDL_Surface\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_DisplayYUVOverlay.3 b/docs/man3/SDL_DisplayYUVOverlay.3 new file mode 100644 index 0000000..d89d94c --- /dev/null +++ b/docs/man3/SDL_DisplayYUVOverlay.3 @@ -0,0 +1,18 @@ +.TH "SDL_DisplayYUVOverlay" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_DisplayYUVOverlay \- Blit the overlay to the display +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_DisplayYUVOverlay\fP\fR(\fBSDL_Overlay *overlay, SDL_Rect *dstrect\fR); +.SH "DESCRIPTION" +.PP +Blit the \fBoverlay\fR to the surface specified when it was \fIcreated\fR\&. The \fI\fBSDL_Rect\fR\fR structure, \fBdstrect\fR, specifies the position and size of the destination\&. If the \fBdstrect\fR is a larger or smaller than the overlay then the overlay will be scaled, this is optimized for 2x scaling\&. +.SH "RETURN VALUES" +.PP +Returns 0 on success +.SH "SEE ALSO" +.PP +\fI\fBSDL_Overlay\fR\fR, \fI\fBSDL_CreateYUVOverlay\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_EnableKeyRepeat.3 b/docs/man3/SDL_EnableKeyRepeat.3 new file mode 100644 index 0000000..ea4b231 --- /dev/null +++ b/docs/man3/SDL_EnableKeyRepeat.3 @@ -0,0 +1,17 @@ +.TH "SDL_EnableKeyRepeat" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_EnableKeyRepeat \- Set keyboard repeat rate\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_EnableKeyRepeat\fP\fR(\fBint delay, int interval\fR); +.SH "DESCRIPTION" +.PP +Enables or disables the keyboard repeat rate\&. \fBdelay\fR specifies how long the key must be pressed before it begins repeating, it then repeats at the speed specified by \fBinterval\fR\&. Both \fBdelay\fR and \fBinterval\fR are expressed in milliseconds\&. +.PP +Setting \fBdelay\fR to 0 disables key repeating completely\&. Good default values are \fBSDL_DEFAULT_REPEAT_DELAY\fP and \fISDL_DEFAULT_REPEAT_INTERVAL\fP\&. +.SH "RETURN VALUE" +.PP +Returns \fB0\fR on success and \fB-1\fR on failure\&. +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_EnableUNICODE.3 b/docs/man3/SDL_EnableUNICODE.3 new file mode 100644 index 0000000..d9d2027 --- /dev/null +++ b/docs/man3/SDL_EnableUNICODE.3 @@ -0,0 +1,24 @@ +.TH "SDL_EnableUNICODE" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_EnableUNICODE \- Enable UNICODE translation +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_EnableUNICODE\fP\fR(\fBint enable\fR); +.SH "DESCRIPTION" +.PP +Enables/Disables Unicode keyboard translation\&. +.PP +To obtain the character codes corresponding to received keyboard events, Unicode translation must first be turned on using this function\&. The translation incurs a slight overhead for each keyboard event and is therefore disabled by default\&. For each subsequently received key down event, the \fBunicode\fR member of the \fI\fBSDL_keysym\fR\fR structure will then contain the corresponding character code, or zero for keysyms that do not correspond to any character code\&. +.PP +A value of 1 for \fBenable\fR enables Unicode translation; 0 disables it, and -1 leaves it unchanged (useful for querying the current translation mode)\&. +.PP +Note that only key press events will be translated, not release events\&. +.SH "RETURN VALUE" +.PP +Returns the previous translation mode (\fB0\fR or \fB1\fR)\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_keysym\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_Event.3 b/docs/man3/SDL_Event.3 new file mode 100644 index 0000000..b508f19 --- /dev/null +++ b/docs/man3/SDL_Event.3 @@ -0,0 +1,182 @@ +.TH "SDL_Event" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_Event \- General event structure +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef union{ + Uint8 type; + SDL_ActiveEvent active; + SDL_KeyboardEvent key; + SDL_MouseMotionEvent motion; + SDL_MouseButtonEvent button; + SDL_JoyAxisEvent jaxis; + SDL_JoyBallEvent jball; + SDL_JoyHatEvent jhat; + SDL_JoyButtonEvent jbutton; + SDL_ResizeEvent resize; + SDL_ExposeEvent expose; + SDL_QuitEvent quit; + SDL_UserEvent user; + SDL_SysWMEvent syswm; +} SDL_Event;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBtype\fR +The type of event +.TP 20 +\fBactive\fR +\fIActivation event\fR +.TP 20 +\fBkey\fR +\fIKeyboard event\fR +.TP 20 +\fBmotion\fR +\fIMouse motion event\fR +.TP 20 +\fBbutton\fR +\fIMouse button event\fR +.TP 20 +\fBjaxis\fR +\fIJoystick axis motion event\fR +.TP 20 +\fBjball\fR +\fIJoystick trackball motion event\fR +.TP 20 +\fBjhat\fR +\fIJoystick hat motion event\fR +.TP 20 +\fBjbutton\fR +\fIJoystick button event\fR +.TP 20 +\fBresize\fR +\fIApplication window resize event\fR +.TP 20 +\fBexpose\fR +\fIApplication window expose event\fR +.TP 20 +\fBquit\fR +\fIApplication quit request event\fR +.TP 20 +\fBuser\fR +\fIUser defined event\fR +.TP 20 +\fBsyswm\fR +\fIUndefined window manager event\fR +.SH "DESCRIPTION" +.PP +The \fBSDL_Event\fR union is the core to all event handling is SDL, its probably the most important structure after \fBSDL_Surface\fR\&. \fBSDL_Event\fR is a union of all event structures used in SDL, using it is a simple matter of knowing which union member relates to which event \fBtype\fR\&. +.PP +.TP 20 +\fBEvent \fBtype\fR\fR +\fBEvent Structure\fR +.TP 20 +\fBSDL_ACTIVEEVENT\fP +\fI\fBSDL_ActiveEvent\fR\fR +.TP 20 +\fBSDL_KEYDOWN/UP\fP +\fI\fBSDL_KeyboardEvent\fR\fR +.TP 20 +\fBSDL_MOUSEMOTION\fP +\fI\fBSDL_MouseMotionEvent\fR\fR +.TP 20 +\fBSDL_MOUSEBUTTONDOWN/UP\fP +\fI\fBSDL_MouseButtonEvent\fR\fR +.TP 20 +\fBSDL_JOYAXISMOTION\fP +\fI\fBSDL_JoyAxisEvent\fR\fR +.TP 20 +\fBSDL_JOYBALLMOTION\fP +\fI\fBSDL_JoyBallEvent\fR\fR +.TP 20 +\fBSDL_JOYHATMOTION\fP +\fI\fBSDL_JoyHatEvent\fR\fR +.TP 20 +\fBSDL_JOYBUTTONDOWN/UP\fP +\fI\fBSDL_JoyButtonEvent\fR\fR +.TP 20 +\fBSDL_QUIT\fP +\fI\fBSDL_QuitEvent\fR\fR +.TP 20 +\fBSDL_SYSWMEVENT\fP +\fI\fBSDL_SysWMEvent\fR\fR +.TP 20 +\fBSDL_VIDEORESIZE\fP +\fI\fBSDL_ResizeEvent\fR\fR +.TP 20 +\fBSDL_VIDEOEXPOSE\fP +\fI\fBSDL_ExposeEvent\fR\fR +.TP 20 +\fBSDL_USEREVENT\fP +\fI\fBSDL_UserEvent\fR\fR +.SH "USE" +.PP +The \fBSDL_Event\fR structure has two uses +.IP " \(bu" 6 +Reading events on the event queue +.IP " \(bu" 6 +Placing events on the event queue +.PP +Reading events from the event queue is done with either \fI\fBSDL_PollEvent\fP\fR or \fI\fBSDL_PeepEvents\fP\fR\&. We\&'ll use \fBSDL_PollEvent\fP and step through an example\&. +.PP +First off, we create an empty \fBSDL_Event\fR structure\&. +.PP +.nf +\f(CWSDL_Event test_event;\fR +.fi +.PP + \fBSDL_PollEvent\fP removes the next event from the event queue, if there are no events on the queue it returns \fB0\fR otherwise it returns \fB1\fR\&. We use a \fBwhile\fP loop to process each event in turn\&. +.PP +.nf +\f(CWwhile(SDL_PollEvent(&test_event)) {\fR +.fi +.PP + The \fBSDL_PollEvent\fP function take a pointer to an \fBSDL_Event\fR structure that is to be filled with event information\&. We know that if \fBSDL_PollEvent\fP removes an event from the queue then the event information will be placed in our \fBtest_event\fR structure, but we also know that the \fItype\fP of event will be placed in the \fBtype\fR member of \fBtest_event\fR\&. So to handle each event \fBtype\fR seperately we use a \fBswitch\fP statement\&. +.PP +.nf +\f(CW switch(test_event\&.type) {\fR +.fi +.PP + We need to know what kind of events we\&'re looking for \fIand\fP the event \fBtype\fR\&'s of those events\&. So lets assume we want to detect where the user is moving the mouse pointer within our application\&. We look through our event types and notice that \fBSDL_MOUSEMOTION\fP is, more than likely, the event we\&'re looking for\&. A little \fImore\fR research tells use that \fBSDL_MOUSEMOTION\fP events are handled within the \fI\fBSDL_MouseMotionEvent\fR\fR structure which is the \fBmotion\fR member of \fBSDL_Event\fR\&. We can check for the \fBSDL_MOUSEMOTION\fP event \fBtype\fR within our \fBswitch\fP statement like so: +.PP +.nf +\f(CW case SDL_MOUSEMOTION:\fR +.fi +.PP + All we need do now is read the information out of the \fBmotion\fR member of \fBtest_event\fR\&. +.PP +.nf +\f(CW printf("We got a motion event\&. +"); + printf("Current mouse position is: (%d, %d) +", test_event\&.motion\&.x, test_event\&.motion\&.y); + break; + default: + printf("Unhandled Event! +"); + break; + } +} +printf("Event queue empty\&. +");\fR +.fi +.PP +.PP +It is also possible to push events onto the event queue and so use it as a two-way communication path\&. Both \fI\fBSDL_PushEvent\fP\fR and \fI\fBSDL_PeepEvents\fP\fR allow you to place events onto the event queue\&. This is usually used to place a \fBSDL_USEREVENT\fP on the event queue, however you could use it to post fake input events if you wished\&. Creating your own events is a simple matter of choosing the event type you want, setting the \fBtype\fR member and filling the appropriate member structure with information\&. +.PP +.nf +\f(CWSDL_Event user_event; + +user_event\&.type=SDL_USEREVENT; +user_event\&.user\&.code=2; +user_event\&.user\&.data1=NULL; +user_event\&.user\&.data2=NULL; +SDL_PushEvent(&user_event);\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_PollEvent\fP\fR, \fI\fBSDL_PushEvent\fP\fR, \fI\fBSDL_PeepEvents\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_EventState.3 b/docs/man3/SDL_EventState.3 new file mode 100644 index 0000000..5ee6ab5 --- /dev/null +++ b/docs/man3/SDL_EventState.3 @@ -0,0 +1,23 @@ +.TH "SDL_EventState" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_EventState \- This function allows you to set the state of processing certain events\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBUint8 \fBSDL_EventState\fP\fR(\fBUint8 type, int state\fR); +.SH "DESCRIPTION" +.PP +This function allows you to set the state of processing certain event \fBtype\fR\&'s\&. +.PP +If \fBstate\fR is set to \fBSDL_IGNORE\fP, that event \fBtype\fR will be automatically dropped from the event queue and will not be filtered\&. +.PP +If \fBstate\fR is set to \fBSDL_ENABLE\fP, that event \fBtype\fR will be processed normally\&. +.PP +If \fBstate\fR is set to \fBSDL_QUERY\fP, \fBSDL_EventState\fP will return the current processing state of the specified event \fBtype\fR\&. +.PP +A list of event \fBtype\fR\&'s can be found in the \fI\fBSDL_Event\fR\fR section\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_Event\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_ExposeEvent.3 b/docs/man3/SDL_ExposeEvent.3 new file mode 100644 index 0000000..e1aa5c3 --- /dev/null +++ b/docs/man3/SDL_ExposeEvent.3 @@ -0,0 +1,24 @@ +.TH "SDL_ExposeEvent" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_ExposeEvent \- Quit requested event +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct{ + Uint8 type +} SDL_ExposeEvent;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBtype\fR +\fBSDL_VIDEOEXPOSE\fP +.SH "DESCRIPTION" +.PP +\fBSDL_ExposeEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used whan an event of type \fBSDL_VIDEOEXPOSE\fP is reported\&. +.PP +A VIDEOEXPOSE event is triggered when the screen has been modified outside of the application, usually by the window manager and needs to be redrawn\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_Event\fR\fR, \fI\fBSDL_SetEventFilter\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_FillRect.3 b/docs/man3/SDL_FillRect.3 new file mode 100644 index 0000000..c2b83ab --- /dev/null +++ b/docs/man3/SDL_FillRect.3 @@ -0,0 +1,22 @@ +.TH "SDL_FillRect" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_FillRect \- This function performs a fast fill of the given rectangle with some color +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_FillRect\fP\fR(\fBSDL_Surface *dst, SDL_Rect *dstrect, Uint32 color\fR); +.SH "DESCRIPTION" +.PP +This function performs a fast fill of the given rectangle with \fBcolor\fR\&. If \fBdstrect\fR is \fBNULL\fP, the whole surface will be filled with \fBcolor\fR\&. +.PP +The color should be a pixel of the format used by the surface, and can be generated by the \fISDL_MapRGB\fR or \fISDL_MapRGBA\fR functions\&. If the color value contains an alpha value then the destination is simply "filled" with that alpha information, no blending takes place\&. +.PP +If there is a clip rectangle set on the destination (set via \fISDL_SetClipRect\fR) then this function will clip based on the intersection of the clip rectangle and the \fBdstrect\fR rectangle and the dstrect rectangle will be modified to represent the area actually filled\&. +.SH "RETURN VALUE" +.PP +This function returns \fB0\fR on success, or \fB-1\fR on error\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_MapRGB\fP\fR, \fI\fBSDL_MapRGBA\fP\fR, \fI\fBSDL_BlitSurface\fP\fR, \fI\fBSDL_Rect\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_Flip.3 b/docs/man3/SDL_Flip.3 new file mode 100644 index 0000000..b3b2d65 --- /dev/null +++ b/docs/man3/SDL_Flip.3 @@ -0,0 +1,20 @@ +.TH "SDL_Flip" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_Flip \- Swaps screen buffers +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_Flip\fP\fR(\fBSDL_Surface *screen\fR); +.SH "DESCRIPTION" +.PP +On hardware that supports double-buffering, this function sets up a flip and returns\&. The hardware will wait for vertical retrace, and then swap video buffers before the next video surface blit or lock will return\&. On hardware that doesn\&'t support double-buffering, this is equivalent to calling \fISDL_UpdateRect\fR\fB(screen, 0, 0, 0, 0)\fR +.PP +The \fBSDL_DOUBLEBUF\fP flag must have been passed to \fISDL_SetVideoMode\fR, when setting the video mode for this function to perform hardware flipping\&. +.SH "RETURN VALUE" +.PP +This function returns \fB0\fR if successful, or \fB-1\fR if there was an error\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_UpdateRect\fP\fR, \fI\fBSDL_Surface\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_FreeCursor.3 b/docs/man3/SDL_FreeCursor.3 new file mode 100644 index 0000000..22277ea --- /dev/null +++ b/docs/man3/SDL_FreeCursor.3 @@ -0,0 +1,15 @@ +.TH "SDL_FreeCursor" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_FreeCursor \- Frees a cursor created with SDL_CreateCursor\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_FreeCursor\fP\fR(\fBSDL_Cursor *cursor\fR); +.SH "DESCRIPTION" +.PP +Frees a \fBSDL_Cursor\fR that was created using \fISDL_CreateCursor\fR\&. +.SH "SEE ALSO" +.PP +\fISDL_CreateCursor\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_FreeSurface.3 b/docs/man3/SDL_FreeSurface.3 new file mode 100644 index 0000000..d849139 --- /dev/null +++ b/docs/man3/SDL_FreeSurface.3 @@ -0,0 +1,15 @@ +.TH "SDL_FreeSurface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_FreeSurface \- Frees (deletes) a SDL_Surface +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_FreeSurface\fP\fR(\fBSDL_Surface *surface\fR); +.SH "DESCRIPTION" +.PP +Frees the resources used by a previously created \fBSDL_Surface\fR\&. If the surface was created using \fISDL_CreateRGBSurfaceFrom\fR then the pixel data is not freed\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_CreateRGBSurface\fP\fR \fI\fBSDL_CreateRGBSurfaceFrom\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_FreeWAV.3 b/docs/man3/SDL_FreeWAV.3 new file mode 100644 index 0000000..a7cd148 --- /dev/null +++ b/docs/man3/SDL_FreeWAV.3 @@ -0,0 +1,15 @@ +.TH "SDL_FreeWAV" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_FreeWAV \- Frees previously opened WAV data +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_FreeWAV\fP\fR(\fBUint8 *audio_buf\fR); +.SH "DESCRIPTION" +.PP +After a WAVE file has been opened with \fI\fBSDL_LoadWAV\fP\fR its data can eventually be freed with \fBSDL_FreeWAV\fP\&. \fBaudio_buf\fR is a pointer to the buffer created by \fBSDL_LoadWAV\fP\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_LoadWAV\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_FreeYUVOverlay.3 b/docs/man3/SDL_FreeYUVOverlay.3 new file mode 100644 index 0000000..3971a93 --- /dev/null +++ b/docs/man3/SDL_FreeYUVOverlay.3 @@ -0,0 +1,15 @@ +.TH "SDL_FreeYUVOverlay" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_FreeYUVOverlay \- Free a YUV video overlay +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_FreeYUVOverlay\fP\fR(\fBSDL_Overlay *overlay\fR); +.SH "DESCRIPTION" +.PP +Frees and \fI\fBoverlay\fR\fR created by \fI\fBSDL_CreateYUVOverlay\fP\fR\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_Overlay\fR\fR, \fI\fBSDL_DisplayYUVOverlay\fP\fR, \fI\fBSDL_FreeYUVOverlay\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GL_GetAttribute.3 b/docs/man3/SDL_GL_GetAttribute.3 new file mode 100644 index 0000000..9135da2 --- /dev/null +++ b/docs/man3/SDL_GL_GetAttribute.3 @@ -0,0 +1,18 @@ +.TH "SDL_GL_GetAttribute" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GL_GetAttribute \- Get the value of a special SDL/OpenGL attribute +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_GL_GetAttribute\fP\fR(\fBSDLGLattr attr, int *value\fR); +.SH "DESCRIPTION" +.PP +Places the value of the SDL/OpenGL \fIattribute\fR \fBattr\fR into \fBvalue\fR\&. This is useful after a call to \fI\fBSDL_SetVideoMode\fP\fR to check whether your attributes have been \fIset\fR as you expected\&. +.SH "RETURN VALUE" +.PP +Returns \fB0\fR on success, or \fB-1\fR on an error\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_GL_SetAttribute\fP\fR, \fIGL Attributes\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GL_GetProcAddress.3 b/docs/man3/SDL_GL_GetProcAddress.3 new file mode 100644 index 0000000..4fcc7a4 --- /dev/null +++ b/docs/man3/SDL_GL_GetProcAddress.3 @@ -0,0 +1,48 @@ +.TH "SDL_GL_GetProcAddress" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GL_GetProcAddress \- Get the address of a GL function +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid *\fBSDL_GL_GetProcAddress\fP\fR(\fBconst char* proc\fR); +.SH "DESCRIPTION" +.PP +Returns the address of the GL function \fBproc\fR, or \fBNULL\fR if the function is not found\&. If the GL library is loaded at runtime, with \fI\fBSDL_GL_LoadLibrary\fP\fR, then \fIall\fP GL functions must be retrieved this way\&. Usually this is used to retrieve function pointers to OpenGL extensions\&. +.SH "EXAMPLE" +.PP +.nf +\f(CWtypedef void (*GL_ActiveTextureARB_Func)(unsigned int); +GL_ActiveTextureARB_Func glActiveTextureARB_ptr = 0; +int has_multitexture=1; +\&. +\&. +\&. +/* Get function pointer */ +glActiveTextureARB_ptr=(GL_ActiveTextureARB_Func) SDL_GL_GetProcAddress("glActiveTextureARB"); + +/* Check for a valid function ptr */ +if(!glActiveTextureARB_ptr){ + fprintf(stderr, "Multitexture Extensions not present\&. +"); + has_multitexture=0; +} +\&. +\&. +\&. +\&. +if(has_multitexture){ + glActiveTextureARB_ptr(GL_TEXTURE0_ARB); + \&. + \&. +} +else{ + \&. + \&. +}\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_GL_LoadLibrary\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GL_LoadLibrary.3 b/docs/man3/SDL_GL_LoadLibrary.3 new file mode 100644 index 0000000..e6544c9 --- /dev/null +++ b/docs/man3/SDL_GL_LoadLibrary.3 @@ -0,0 +1,15 @@ +.TH "SDL_GL_LoadLibrary" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GL_LoadLibrary \- Specify an OpenGL library +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_GL_LoadLibrary\fP\fR(\fBconst char *path\fR); +.SH "DESCRIPTION" +.PP +If you wish, you may load the OpenGL library at runtime, this must be done before \fI\fBSDL_SetVideoMode\fP\fR is called\&. The \fBpath\fR of the GL library is passed to \fBSDL_GL_LoadLibrary\fP and it returns \fB0\fR on success, or \fB-1\fR on an error\&. You must then use \fI\fBSDL_GL_GetProcAddress\fP\fR to retrieve function pointers to GL functions\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_GL_GetProcAddress\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GL_SetAttribute.3 b/docs/man3/SDL_GL_SetAttribute.3 new file mode 100644 index 0000000..deb38e7 --- /dev/null +++ b/docs/man3/SDL_GL_SetAttribute.3 @@ -0,0 +1,40 @@ +.TH "SDL_GL_SetAttribute" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GL_SetAttribute \- Set a special SDL/OpenGL attribute +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_GL_SetAttribute\fP\fR(\fBSDL_GLattr attr, int value\fR); +.SH "DESCRIPTION" +.PP +Sets the OpenGL \fIattribute\fR \fBattr\fR to \fBvalue\fR\&. The attributes you set don\&'t take effect until after a call to \fI\fBSDL_SetVideoMode\fP\fR\&. You should use \fI\fBSDL_GL_GetAttribute\fP\fR to check the values after a \fBSDL_SetVideoMode\fP call\&. +.SH "RETURN VALUE" +.PP +Returns \fB0\fR on success, or \fB-1\fR on error\&. +.SH "EXAMPLE" +.PP +.nf +\f(CWSDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 ); +SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 ); +SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 ); +SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 ); +SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); +if ( (screen=SDL_SetVideoMode( 640, 480, 16, SDL_OPENGL )) == NULL ) { + fprintf(stderr, "Couldn\&'t set GL mode: %s +", SDL_GetError()); + SDL_Quit(); + return; +}\fR +.fi +.PP +.PP +.RS +\fBNote: +.PP +The \fBSDL_DOUBLEBUF\fP flag is not required to enable double buffering when setting an OpenGL video mode\&. Double buffering is enabled or disabled using the SDL_GL_DOUBLEBUFFER attribute\&. +.RE +.SH "SEE ALSO" +.PP +\fI\fBSDL_GL_GetAttribute\fP\fR, \fIGL Attributes\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GL_SwapBuffers.3 b/docs/man3/SDL_GL_SwapBuffers.3 new file mode 100644 index 0000000..31d31cf --- /dev/null +++ b/docs/man3/SDL_GL_SwapBuffers.3 @@ -0,0 +1,15 @@ +.TH "SDL_GL_SwapBuffers" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GL_SwapBuffers \- Swap OpenGL framebuffers/Update Display +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_GL_SwapBuffers\fP\fR(\fBvoid \fR); +.SH "DESCRIPTION" +.PP +Swap the OpenGL buffers, if double-buffering is supported\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_GL_SetAttribute\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GLattr.3 b/docs/man3/SDL_GLattr.3 new file mode 100644 index 0000000..23d3726 --- /dev/null +++ b/docs/man3/SDL_GLattr.3 @@ -0,0 +1,47 @@ +.TH "SDL_GLattr" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GLattr \- SDL GL Attributes +.SH "ATTRIBUTES" +.TP 20 +\fBSDL_GL_RED_SIZE\fP +Size of the framebuffer red component, in bits +.TP 20 +\fBSDL_GL_GREEN_SIZE\fP +Size of the framebuffer green component, in bits +.TP 20 +\fBSDL_GL_BLUE_SIZE\fP +Size of the framebuffer blue component, in bits +.TP 20 +\fBSDL_GL_ALPHA_SIZE\fP +Size of the framebuffer alpha component, in bits +.TP 20 +\fBSDL_GL_DOUBLEBUFFER\fP +0 or 1, enable or disable double buffering +.TP 20 +\fBSDL_GL_BUFFER_SIZE\fP +Size of the framebuffer, in bits +.TP 20 +\fBSDL_GL_DEPTH_SIZE\fP +Size of the depth buffer, in bits +.TP 20 +\fBSDL_GL_STENCIL_SIZE\fP +Size of the stencil buffer, in bits +.TP 20 +\fBSDL_GL_ACCUM_RED_SIZE\fP +Size of the accumulation buffer red component, in bits +.TP 20 +\fBSDL_GL_ACCUM_GREEN_SIZE\fP +Size of the accumulation buffer green component, in bits +.TP 20 +\fBSDL_GL_ACCUM_BLUE_SIZE\fP +Size of the accumulation buffer blue component, in bits +.TP 20 +\fBSDL_GL_ACCUM_ALPHA_SIZE\fP +Size of the accumulation buffer alpha component, in bits +.SH "DESCRIPTION" +.PP +While you can set most OpenGL attributes normally, the attributes list above must be known \fIbefore\fP SDL sets the video mode\&. These attributes a set and read with \fI\fBSDL_GL_SetAttribute\fP\fR and \fI\fBSDL_GL_GetAttribute\fP\fR\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_GL_SetAttribute\fP\fR, \fI\fBSDL_GL_GetAttribute\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GetAppState.3 b/docs/man3/SDL_GetAppState.3 new file mode 100644 index 0000000..9d644a1 --- /dev/null +++ b/docs/man3/SDL_GetAppState.3 @@ -0,0 +1,24 @@ +.TH "SDL_GetAppState" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +\fBSDL_GetAppState\fP \- Get the state of the application +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBUint8 \fBSDL_GetAppState\fP\fR(\fBvoid\fR); +.SH "DESCRIPTION" +.PP +This function returns the current state of the application\&. The value returned is a bitwise combination of: +.TP 20 +\fBSDL_APPMOUSEFOCUS\fP +The application has mouse focus\&. +.TP 20 +\fBSDL_APPINPUTFOCUS\fP +The application has keyboard focus +.TP 20 +\fBSDL_APPACTIVE\fP +The application is visible +.SH "SEE ALSO" +.PP +\fI\fBSDL_ActiveEvent\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_GetAudioStatus.3 b/docs/man3/SDL_GetAudioStatus.3 new file mode 100644 index 0000000..9895c95 --- /dev/null +++ b/docs/man3/SDL_GetAudioStatus.3 @@ -0,0 +1,24 @@ +.TH "SDL_GetAudioStatus" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GetAudioStatus \- Get the current audio state +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBSDL_audiostatus\fBSDL_GetAudioStatus\fP\fR(\fBvoid\fR); +.SH "DESCRIPTION" +.PP +.nf +\f(CWtypedef enum{ + SDL_AUDIO_STOPPED, + SDL_AUDIO_PAUSED, + SDL_AUDIO_PLAYING +} SDL_audiostatus;\fR +.fi +.PP +.PP +Returns either \fBSDL_AUDIO_STOPPED\fP, \fBSDL_AUDIO_PAUSED\fP or \fBSDL_AUDIO_PLAYING\fP depending on the current audio state\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_PauseAudio\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_GetClipRect.3 b/docs/man3/SDL_GetClipRect.3 new file mode 100644 index 0000000..b911ff6 --- /dev/null +++ b/docs/man3/SDL_GetClipRect.3 @@ -0,0 +1,17 @@ +.TH "SDL_GetClipRect" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GetClipRect \- Gets the clipping rectangle for a surface\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_GetClipRect\fP\fR(\fBSDL_Surface *surface, SDL_Rect *rect\fR); +.SH "DESCRIPTION" +.PP +Gets the clipping rectangle for a surface\&. When this surface is the destination of a blit, only the area within the clip rectangle is drawn into\&. +.PP +The rectangle pointed to by \fBrect\fR will be filled with the clipping rectangle of the surface\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_SetClipRect\fP\fR, \fI\fBSDL_BlitSurface\fP\fR, \fI\fBSDL_Surface\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GetCursor.3 b/docs/man3/SDL_GetCursor.3 new file mode 100644 index 0000000..ce5ba72 --- /dev/null +++ b/docs/man3/SDL_GetCursor.3 @@ -0,0 +1,15 @@ +.TH "SDL_GetCursor" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GetCursor \- Get the currently active mouse cursor\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBSDL_Cursor *\fBSDL_GetCursor\fP\fR(\fBvoid\fR); +.SH "DESCRIPTION" +.PP +Returns the currently active mouse cursor\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_SetCursor\fP\fR, \fI\fBSDL_CreateCursor\fP\fR, \fI\fBSDL_ShowCursor\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GetError.3 b/docs/man3/SDL_GetError.3 new file mode 100644 index 0000000..ecdb98c --- /dev/null +++ b/docs/man3/SDL_GetError.3 @@ -0,0 +1,15 @@ +.TH "SDL_GetError" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GetError \- Get SDL error string +.SH "SYNOPSIS" +.PP +\fB#include "SDL/SDL\&.h" +.sp +\fBchar *\fBSDL_GetError\fP\fR(\fBvoid\fR); +.SH "DESCRIPTION" +.PP +\fBSDL_GetError\fP returns a NULL terminated string containing information about the last internal SDL error\&. +.SH "RETURN VALUE" +.PP +\fBSDL_GetError\fP returns a string containing the last error\&. +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_GetEventFilter.3 b/docs/man3/SDL_GetEventFilter.3 new file mode 100644 index 0000000..41bf337 --- /dev/null +++ b/docs/man3/SDL_GetEventFilter.3 @@ -0,0 +1,23 @@ +.TH "SDL_GetEventFilter" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GetEventFilter \- Retrieves a pointer to he event filter +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBSDL_EventFilter \fBSDL_GetEventFilter\fP\fR(\fBvoid\fR); +.SH "DESCRIPTION" +.PP +This function retrieces a pointer to the event filter that was previously set using \fI\fBSDL_SetEventFilter\fP\fR\&. An SDL_EventFilter function is defined as: +.PP +.nf +\f(CWtypedef int (*SDL_EventFilter)(const SDL_Event *event);\fR +.fi +.PP +.SH "RETURN VALUE" +.PP +Returns a pointer to the event filter or \fBNULL\fP if no filter has been set\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_Event\fR\fR, \fI\fBSDL_SetEventFilter\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_GetGamma.3 b/docs/man3/SDL_GetGamma.3 new file mode 100644 index 0000000..f3493aa --- /dev/null +++ b/docs/man3/SDL_GetGamma.3 @@ -0,0 +1,21 @@ +.TH "SDL_GetGamma" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GetGamma \- Gets the gamma of the display +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_GetGamma\fP\fR(\fBfloat *red, float *green, float *blue\fR); +.SH "DESCRIPTION" +.PP +Gets the color gamma of the display\&. The gamma value for each color component will be place in the parameters \fBred\fR, \fBgreen\fR and \fBblue\fR\&. The values can range from 0\&.1 to 10\&. +.PP +.RS +\fBNote: +.PP +This function currently only works on XFreee 4\&.0 and up\&. +.RE +.SH "SEE ALSO" +.PP +\fI\fBSDL_SetGamma\fP\fR, \fI\fBSDL_SetVideoMode\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GetGammaRamp.3 b/docs/man3/SDL_GetGammaRamp.3 new file mode 100644 index 0000000..c1116d5 --- /dev/null +++ b/docs/man3/SDL_GetGammaRamp.3 @@ -0,0 +1,20 @@ +.TH "SDL_GetGammaRamp" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GetGammaRamp \- Gets the color gamma lookup tables for the display +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_GetGammaRamp\fP\fR(\fBUint16 *redtable, Uint16 *greentable, Uint16 *bluetable\fR); +.SH "DESCRIPTION" +.PP +Gets the gamma translation lookup tables currently used by the display\&. Each table is an array of 256 Uint16 values\&. +.PP +Not all display hardware is able to change gamma\&. +.SH "RETURN VALUE" +.PP +Returns -1 on error\&. +.SH "SEE ALSO" +.PP +\fISDL_SetGamma\fR \fISDL_SetGammaRamp\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GetKeyName.3 b/docs/man3/SDL_GetKeyName.3 new file mode 100644 index 0000000..fc76ca8 --- /dev/null +++ b/docs/man3/SDL_GetKeyName.3 @@ -0,0 +1,15 @@ +.TH "SDL_GetKeyName" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GetKeyName \- Get the name of an SDL virtual keysym +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBchar *\fBSDL_GetKeyName\fP\fR(\fBSDLKey key\fR); +.SH "DESCRIPTION" +.PP +Returns the SDL-defined name of the \fI\fBSDLKey\fR\fR \fBkey\fR\&. +.SH "SEE ALSO" +.PP +\fI\fBSDLKey\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_GetKeyState.3 b/docs/man3/SDL_GetKeyState.3 new file mode 100644 index 0000000..f679c81 --- /dev/null +++ b/docs/man3/SDL_GetKeyState.3 @@ -0,0 +1,30 @@ +.TH "SDL_GetKeyState" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GetKeyState \- Get a snapshot of the current keyboard state +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBUint8 *\fBSDL_GetKeyState\fP\fR(\fBint *numkeys\fR); +.SH "DESCRIPTION" +.PP +Gets a snapshot of the current keyboard state\&. The current state is return as a pointer to an array, the size of this array is stored in \fBnumkeys\fR\&. The array is indexed by the \fI\fBSDLK_*\fP\fR symbols\&. A value of 1 means the key is pressed and a value of 0 means its not\&. The pointer returned is a pointer to an internal SDL array and should not be freed by the caller\&. +.PP +.RS +\fBNote: +.PP +Use \fI\fBSDL_PumpEvents\fP\fR to update the state array\&. +.RE +.SH "EXAMPLE" +.PP +.PP +.nf +\f(CWUint8 *keystate = SDL_GetKeyState(NULL); +if ( keystate[SDLK_RETURN] ) printf("Return Key Pressed\&. +");\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL Key Symbols\fP\fR, \fI\fBSDL_PumpEvents\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_GetModState.3 b/docs/man3/SDL_GetModState.3 new file mode 100644 index 0000000..5cff3d5 --- /dev/null +++ b/docs/man3/SDL_GetModState.3 @@ -0,0 +1,54 @@ +.TH "SDL_GetModState" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GetModState \- Get the state of modifier keys\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBSDLMod \fBSDL_GetModState\fP\fR(\fBvoid\fR); +.SH "DESCRIPTION" +.PP +Returns the current state of the modifier keys (CTRL, ALT, etc\&.)\&. +.SH "RETURN VALUE" +.PP +The return value can be an OR\&'d combination of the SDLMod enum\&. +.PP +.PP +.RS +\fBSDLMod\fR +.PP +.PP +.nf +\f(CWtypedef enum { + KMOD_NONE = 0x0000, + KMOD_LSHIFT= 0x0001, + KMOD_RSHIFT= 0x0002, + KMOD_LCTRL = 0x0040, + KMOD_RCTRL = 0x0080, + KMOD_LALT = 0x0100, + KMOD_RALT = 0x0200, + KMOD_LMETA = 0x0400, + KMOD_RMETA = 0x0800, + KMOD_NUM = 0x1000, + KMOD_CAPS = 0x2000, + KMOD_MODE = 0x4000, +} SDLMod;\fR +.fi +.PP +.RE + SDL also defines the following symbols for convenience: +.PP +.RS +.PP +.nf +\f(CW#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) +#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) +#define KMOD_ALT (KMOD_LALT|KMOD_RALT) +#define KMOD_META (KMOD_LMETA|KMOD_RMETA)\fR +.fi +.PP +.RE +.SH "SEE ALSO" +.PP +\fI\fBSDL_GetKeyState\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_GetMouseState.3 b/docs/man3/SDL_GetMouseState.3 new file mode 100644 index 0000000..e92aa43 --- /dev/null +++ b/docs/man3/SDL_GetMouseState.3 @@ -0,0 +1,24 @@ +.TH "SDL_GetMouseState" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GetMouseState \- Retrieve the current state of the mouse +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBUint8 \fBSDL_GetMouseState\fP\fR(\fBint *x, int *y\fR); +.SH "DESCRIPTION" +.PP +The current button state is returned as a button bitmask, which can be tested using the \fBSDL_BUTTON(X)\fP macros, and \fBx\fR and \fBy\fR are set to the current mouse cursor position\&. You can pass \fBNULL\fP for either \fBx\fR or \fBy\fR\&. +.SH "EXAMPLE" +.PP +.nf +\f(CWSDL_PumpEvents(); +if(SDL_GetMouseState(NULL, NULL)&SDL_BUTTON(1)) + printf("Mouse Button 1(left) is pressed\&. +");\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_GetRelativeMouseState\fP\fR, \fI\fBSDL_PumpEvents\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_GetRGB.3 b/docs/man3/SDL_GetRGB.3 new file mode 100644 index 0000000..f21a162 --- /dev/null +++ b/docs/man3/SDL_GetRGB.3 @@ -0,0 +1,17 @@ +.TH "SDL_GetRGB" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GetRGB \- Get RGB values from a pixel in the specified pixel format\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_GetRGB\fP\fR(\fBUint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, Uint8 *g, Uint8 *b\fR); +.SH "DESCRIPTION" +.PP +Get RGB component values from a pixel stored in the specified pixel format\&. +.PP +This function uses the entire 8-bit [0\&.\&.255] range when converting color components from pixel formats with less than 8-bits per RGB component (e\&.g\&., a completely white pixel in 16-bit RGB565 format would return [0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8])\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_GetRGBA\fP\fR, \fI\fBSDL_MapRGB\fP\fR, \fI\fBSDL_MapRGBA\fP\fR, \fI\fBSDL_PixelFormat\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GetRGBA.3 b/docs/man3/SDL_GetRGBA.3 new file mode 100644 index 0000000..eba9dfb --- /dev/null +++ b/docs/man3/SDL_GetRGBA.3 @@ -0,0 +1,19 @@ +.TH "SDL_GetRGBA" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GetRGBA \- Get RGBA values from a pixel in the specified pixel format\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_GetRGBA\fP\fR(\fBUint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a\fR); +.SH "DESCRIPTION" +.PP +Get RGBA component values from a pixel stored in the specified pixel format\&. +.PP +This function uses the entire 8-bit [0\&.\&.255] range when converting color components from pixel formats with less than 8-bits per RGB component (e\&.g\&., a completely white pixel in 16-bit RGB565 format would return [0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8])\&. +.PP +If the surface has no alpha component, the alpha will be returned as 0xff (100% opaque)\&. +.SH "SEE ALSO" +.PP +\fISDL_GetRGB\fR, \fISDL_MapRGB\fR, \fISDL_MapRGBA\fR, \fISDL_PixelFormat\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GetRelativeMouseState.3 b/docs/man3/SDL_GetRelativeMouseState.3 new file mode 100644 index 0000000..349f47d --- /dev/null +++ b/docs/man3/SDL_GetRelativeMouseState.3 @@ -0,0 +1,15 @@ +.TH "SDL_GetRelativeMouseState" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GetRelativeMouseState \- Retrieve the current state of the mouse +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBUint8 \fBSDL_GetRelativeMouseState\fP\fR(\fBint *x, int *y\fR); +.SH "DESCRIPTION" +.PP +The current button state is returned as a button bitmask, which can be tested using the \fBSDL_BUTTON(X)\fP macros, and \fBx\fR and \fBy\fR are set to the change in the mouse position since the last call to \fBSDL_GetRelativeMouseState\fP or since event initialization\&. You can pass \fBNULL\fP for either \fBx\fR or \fBy\fR\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_GetMouseState\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_GetThreadID.3 b/docs/man3/SDL_GetThreadID.3 new file mode 100644 index 0000000..6385aeb --- /dev/null +++ b/docs/man3/SDL_GetThreadID.3 @@ -0,0 +1,16 @@ +.TH "SDL_GetThreadID" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GetThreadID \- Get the SDL thread ID of a SDL_Thread +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +#include "SDL_thread\&.h" +.sp +\fBUint32 \fBSDL_GetThreadID\fP\fR(\fBSDL_Thread *thread\fR); +.SH "DESCRIPTION" +.PP +Returns the ID of a \fBSDL_Thread\fR created by \fISDL_CreateThread\fR\&. +.SH "SEE ALSO" +.PP +\fISDL_CreateThread\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_GetTicks.3 b/docs/man3/SDL_GetTicks.3 new file mode 100644 index 0000000..4615737 --- /dev/null +++ b/docs/man3/SDL_GetTicks.3 @@ -0,0 +1,15 @@ +.TH "SDL_GetTicks" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GetTicks \- Get the number of milliseconds since the SDL library initialization\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBUint32 \fBSDL_GetTicks\fP\fR(\fBvoid\fR) +.SH "DESCRIPTION" +.PP +Get the number of milliseconds since the SDL library initialization\&. Note that this value wraps if the program runs for more than ~49 days\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_Delay\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GetVideoInfo.3 b/docs/man3/SDL_GetVideoInfo.3 new file mode 100644 index 0000000..b82b28e --- /dev/null +++ b/docs/man3/SDL_GetVideoInfo.3 @@ -0,0 +1,15 @@ +.TH "SDL_GetVideoInfo" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GetVideoInfo \- returns a pointer to information about the video hardware +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBSDL_VideoInfo *\fBSDL_GetVideoInfo\fP\fR(\fBvoid\fR); +.SH "DESCRIPTION" +.PP +This function returns a read-only pointer to \fIinformation\fR about the video hardware\&. If this is called before \fISDL_SetVideoMode\fR, the \fBvfmt\fR member of the returned structure will contain the pixel format of the "best" video mode\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_VideoInfo\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GetVideoSurface.3 b/docs/man3/SDL_GetVideoSurface.3 new file mode 100644 index 0000000..4a5d7eb --- /dev/null +++ b/docs/man3/SDL_GetVideoSurface.3 @@ -0,0 +1,15 @@ +.TH "SDL_GetVideoSurface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_GetVideoSurface \- returns a pointer to the current display surface +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBSDL_Surface *\fBSDL_GetVideoSurface\fP\fR(\fBvoid\fR); +.SH "DESCRIPTION" +.PP +This function returns a pointer to the current display surface\&. If SDL is doing format conversion on the display surface, this function returns the publicly visible surface, not the real video surface\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_Surface\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_Init.3 b/docs/man3/SDL_Init.3 new file mode 100644 index 0000000..5f50054 --- /dev/null +++ b/docs/man3/SDL_Init.3 @@ -0,0 +1,41 @@ +.TH "SDL_Init" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_Init \- Initializes SDL +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_Init\fP\fR(\fBUint32 flags\fR); +.SH "DESCRIPTION" +.PP +Initializes SDL\&. This should be called before all other SDL functions\&. The \fBflags\fR parameter specifies what part(s) of SDL to initialize\&. +.TP 20 +\fBSDL_INIT_TIMER\fP +Initializes the \fItimer\fR subsystem\&. +.TP 20 +\fBSDL_INIT_AUDIO\fP +Initializes the \fIaudio\fR subsystem\&. +.TP 20 +\fBSDL_INIT_VIDEO\fP +Initializes the \fIvideo\fR subsystem\&. +.TP 20 +\fBSDL_INIT_CDROM\fP +Initializes the \fIcdrom\fR subsystem\&. +.TP 20 +\fBSDL_INIT_JOYSTICK\fP +Initializes the \fIjoystick\fR subsystem\&. +.TP 20 +\fBSDL_INIT_EVERYTHING\fP +Initialize all of the above\&. +.TP 20 +\fBSDL_INIT_NOPARACHUTE\fP +Prevents SDL from catching fatal signals\&. +.TP 20 +\fBSDL_INIT_EVENTTHREAD\fP +.SH "RETURN VALUE" +.PP +Returns \fB-1\fR on an error or \fB0\fR on success\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_Quit\fP\fR, \fI\fBSDL_InitSubSystem\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_InitSubSystem.3 b/docs/man3/SDL_InitSubSystem.3 new file mode 100644 index 0000000..f0a82a5 --- /dev/null +++ b/docs/man3/SDL_InitSubSystem.3 @@ -0,0 +1,41 @@ +.TH "SDL_InitSubSystem" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_InitSubSystem \- Initialize subsystems +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_InitSubSystem\fP\fR(\fBUint32 flags\fR); +.SH "DESCRIPTION" +.PP +After SDL has been initialized with \fI\fBSDL_Init\fP\fR you may initialize uninitialized subsystems with \fBSDL_InitSubSystem\fP\&. The \fBflags\fR parameter is the same as that used in \fI\fBSDL_Init\fP\fR\&. +.SH "EXAMPLES" +.PP +.nf +\f(CW/* Seperating Joystick and Video initialization\&. */ +SDL_Init(SDL_INIT_VIDEO); +\&. +\&. +SDL_SetVideoMode(640, 480, 16, SDL_DOUBLEBUF|SDL_FULLSCREEN); +\&. +/* Do Some Video stuff */ +\&. +\&. +/* Initialize the joystick subsystem */ +SDL_InitSubSystem(SDL_INIT_JOYSTICK); + +/* Do some stuff with video and joystick */ +\&. +\&. +\&. +/* Shut them both down */ +SDL_Quit();\fR +.fi +.PP +.SH "RETURN VALUE" +.PP +Returns \fB-1\fR on an error or \fB0\fR on success\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_Init\fP\fR, \fI\fBSDL_Quit\fP\fR, \fI\fBSDL_QuitSubSystem\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_JoyAxisEvent.3 b/docs/man3/SDL_JoyAxisEvent.3 new file mode 100644 index 0000000..f8301fd --- /dev/null +++ b/docs/man3/SDL_JoyAxisEvent.3 @@ -0,0 +1,36 @@ +.TH "SDL_JoyAxisEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_JoyAxisEvent \- Joystick axis motion event structure +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct{ + Uint8 type; + Uint8 which; + Uint8 axis; + Sint16 value; +} SDL_JoyAxisEvent;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBtype\fR +\fBSDL_JOYAXISMOTION\fP +.TP 20 +\fBwhich\fR +Joystick device index +.TP 20 +\fBaxis\fR +Joystick axis index +.TP 20 +\fBvalue\fR +Axis value (range: -32768 to 32767) +.SH "DESCRIPTION" +.PP +\fBSDL_JoyAxisEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_JOYAXISMOTION\fP is reported\&. +.PP +A \fBSDL_JOYAXISMOTION\fP event occurs when ever a user moves an axis on the joystick\&. The field \fBwhich\fR is the index of the joystick that reported the event and \fBaxis\fR is the index of the axis (for a more detailed explaination see the \fIJoystick section\fR)\&. \fBvalue\fR is the current position of the axis\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_Event\fR\fR, \fIJoystick Functions\fR, \fI\fBSDL_JoystickEventState\fP\fR, \fI\fBSDL_JoystickGetAxis\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_JoyBallEvent.3 b/docs/man3/SDL_JoyBallEvent.3 new file mode 100644 index 0000000..7f42f7b --- /dev/null +++ b/docs/man3/SDL_JoyBallEvent.3 @@ -0,0 +1,36 @@ +.TH "SDL_JoyBallEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_JoyBallEvent \- Joystick trackball motion event structure +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct{ + Uint8 type; + Uint8 which; + Uint8 ball; + Sint16 xrel, yrel; +} SDL_JoyBallEvent;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBtype\fR +\fBSDL_JOYBALLMOTION\fP +.TP 20 +\fBwhich\fR +Joystick device index +.TP 20 +\fBball\fR +Joystick trackball index +.TP 20 +\fBxrel\fR, \fByrel\fR +The relative motion in the X/Y direction +.SH "DESCRIPTION" +.PP +\fBSDL_JoyBallEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_JOYBALLMOTION\fP is reported\&. +.PP +A \fBSDL_JOYBALLMOTION\fP event occurs when a user moves a trackball on the joystick\&. The field \fBwhich\fR is the index of the joystick that reported the event and \fBball\fR is the index of the trackball (for a more detailed explaination see the \fIJoystick section\fR)\&. Trackballs only return relative motion, this is the change in position on the ball since it was last polled (last cycle of the event loop) and it is stored in \fBxrel\fR and \fByrel\fR\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_Event\fR\fR, \fIJoystick Functions\fR, \fI\fBSDL_JoystickEventState\fP\fR, \fI\fBSDL_JoystickGetBall\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_JoyButtonEvent.3 b/docs/man3/SDL_JoyButtonEvent.3 new file mode 100644 index 0000000..dfd0793 --- /dev/null +++ b/docs/man3/SDL_JoyButtonEvent.3 @@ -0,0 +1,36 @@ +.TH "SDL_JoyButtonEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_JoyButtonEvent \- Joystick button event structure +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct{ + Uint8 type; + Uint8 which; + Uint8 button; + Uint8 state; +} SDL_JoyButtonEvent;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBtype\fR +\fBSDL_JOYBUTTONDOWN\fP or \fBSDL_JOYBUTTONUP\fP +.TP 20 +\fBwhich\fR +Joystick device index +.TP 20 +\fBbutton\fR +Joystick button index +.TP 20 +\fBstate\fR +\fBSDL_PRESSED\fP or \fBSDL_RELEASED\fP +.SH "DESCRIPTION" +.PP +\fBSDL_JoyButtonEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_JOYBUTTONDOWN\fP or \fBSDL_JOYBUTTONUP\fP is reported\&. +.PP +A \fBSDL_JOYBUTTONDOWN\fP or \fBSDL_JOYBUTTONUP\fP event occurs when ever a user presses or releases a button on a joystick\&. The field \fBwhich\fR is the index of the joystick that reported the event and \fBbutton\fR is the index of the button (for a more detailed explaination see the \fIJoystick section\fR)\&. \fBstate\fR is the current state or the button which is either \fBSDL_PRESSED\fP or \fBSDL_RELEASED\fP\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_Event\fR\fR, \fIJoystick Functions\fR, \fI\fBSDL_JoystickEventState\fP\fR, \fI\fBSDL_JoystickGetButton\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_JoyHatEvent.3 b/docs/man3/SDL_JoyHatEvent.3 new file mode 100644 index 0000000..5817ad6 --- /dev/null +++ b/docs/man3/SDL_JoyHatEvent.3 @@ -0,0 +1,56 @@ +.TH "SDL_JoyHatEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_JoyHatEvent \- Joystick hat position change event structure +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct{ + Uint8 type; + Uint8 which; + Uint8 hat; + Uint8 value; +} SDL_JoyHatEvent;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBtype\fR +\fBSDL_JOY\fP +.TP 20 +\fBwhich\fR +Joystick device index +.TP 20 +\fBhat\fR +Joystick hat index +.TP 20 +\fBvalue\fR +Hat position +.SH "DESCRIPTION" +.PP +\fBSDL_JoyHatEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_JOYHATMOTION\fP is reported\&. +.PP +A \fBSDL_JOYHATMOTION\fP event occurs when ever a user moves a hat on the joystick\&. The field \fBwhich\fR is the index of the joystick that reported the event and \fBhat\fR is the index of the hat (for a more detailed exlaination see the \fIJoystick section\fR)\&. \fBvalue\fR is the current position of the hat\&. It is a logically OR\&'d combination of the following values (whose meanings should be pretty obvious:) : +.IP "" 10 +\fBSDL_HAT_CENTERED\fP +.IP "" 10 +\fBSDL_HAT_UP\fP +.IP "" 10 +\fBSDL_HAT_RIGHT\fP +.IP "" 10 +\fBSDL_HAT_DOWN\fP +.IP "" 10 +\fBSDL_HAT_LEFT\fP +.PP +The following defines are also provided: +.IP "" 10 +\fBSDL_HAT_RIGHTUP\fP +.IP "" 10 +\fBSDL_HAT_RIGHTDOWN\fP +.IP "" 10 +\fBSDL_HAT_LEFTUP\fP +.IP "" 10 +\fBSDL_HAT_LEFTDOWN\fP +.SH "SEE ALSO" +.PP +\fI\fBSDL_Event\fR\fR, \fIJoystick Functions\fR, \fI\fBSDL_JoystickEventState\fP\fR, \fI\fBSDL_JoystickGetHat\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_JoystickClose.3 b/docs/man3/SDL_JoystickClose.3 new file mode 100644 index 0000000..281702f --- /dev/null +++ b/docs/man3/SDL_JoystickClose.3 @@ -0,0 +1,15 @@ +.TH "SDL_JoystickClose" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_JoystickClose \- Closes a previously opened joystick +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_JoystickClose\fP\fR(\fBSDL_Joystick *joystick\fR); +.SH "DESCRIPTION" +.PP +Close a \fBjoystick\fR that was previously opened with \fI\fBSDL_JoystickOpen\fP\fR\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_JoystickOpen\fP\fR, \fI\fBSDL_JoystickOpened\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_JoystickEventState.3 b/docs/man3/SDL_JoystickEventState.3 new file mode 100644 index 0000000..7e410f3 --- /dev/null +++ b/docs/man3/SDL_JoystickEventState.3 @@ -0,0 +1,24 @@ +.TH "SDL_JoystickEventState" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_JoystickEventState \- Enable/disable joystick event polling +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_JoystickEventState\fP\fR(\fBint state\fR); +.SH "DESCRIPTION" +.PP +This function is used to enable or disable joystick event processing\&. With joystick event processing disabled you will have to update joystick states with \fI\fBSDL_JoystickUpdate\fP\fR and read the joystick information manually\&. \fBstate\fR is either \fBSDL_QUERY\fP, \fBSDL_ENABLE\fP or \fBSDL_IGNORE\fP\&. +.PP +.RS +\fBNote: +.PP +Joystick event handling is prefered +.RE +.SH "RETURN VALUE" +.PP +If \fBstate\fR is \fBSDL_QUERY\fP then the current state is returned, otherwise the new processing \fBstate\fR is returned\&. +.SH "SEE ALSO" +.PP +\fISDL Joystick Functions\fR, \fI\fBSDL_JoystickUpdate\fP\fR, \fI\fBSDL_JoyAxisEvent\fR\fR, \fI\fBSDL_JoyBallEvent\fR\fR, \fI\fBSDL_JoyButtonEvent\fR\fR, \fI\fBSDL_JoyHatEvent\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_JoystickGetAxis.3 b/docs/man3/SDL_JoystickGetAxis.3 new file mode 100644 index 0000000..0a80b34 --- /dev/null +++ b/docs/man3/SDL_JoystickGetAxis.3 @@ -0,0 +1,32 @@ +.TH "SDL_JoystickGetAxis" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_JoystickGetAxis \- Get the current state of an axis +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBSint16 \fBSDL_JoystickGetAxis\fP\fR(\fBSDL_Joystick *joystick, int axis\fR); +.SH "DESCRIPTION" +.PP +\fBSDL_JoystickGetAxis\fP returns the current state of the given \fBaxis\fR on the given \fBjoystick\fR\&. +.PP +On most modern joysticks the X axis is usually represented by \fBaxis\fR 0 and the Y axis by \fBaxis\fR 1\&. The value returned by \fBSDL_JoystickGetAxis\fP is a signed integer (-32768 to 32768) representing the current position of the \fBaxis\fR, it maybe necessary to impose certain tolerances on these values to account for jitter\&. It is worth noting that some joysticks use axes 2 and 3 for extra buttons\&. +.SH "RETURN VALUE" +.PP +Returns a 16-bit signed integer representing the current position of the \fBaxis\fR\&. +.SH "EXAMPLES" +.PP +.PP +.nf +\f(CWSint16 x_move, y_move; +SDL_Joystick *joy1; +\&. +\&. +x_move=SDL_JoystickGetAxis(joy1, 0); +y_move=SDL_JoystickGetAxis(joy1, 1);\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_JoystickNumAxes\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_JoystickGetBall.3 b/docs/man3/SDL_JoystickGetBall.3 new file mode 100644 index 0000000..124c910 --- /dev/null +++ b/docs/man3/SDL_JoystickGetBall.3 @@ -0,0 +1,37 @@ +.TH "SDL_JoystickGetBall" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_JoystickGetBall \- Get relative trackball motion +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_JoystickGetBall\fP\fR(\fBSDL_Joystick *joystick, int ball, int *dx, int *dy\fR); +.SH "DESCRIPTION" +.PP +Get the \fBball\fR axis change\&. +.PP +Trackballs can only return relative motion since the last call to \fBSDL_JoystickGetBall\fP, these motion deltas a placed into \fBdx\fR and \fBdy\fR\&. +.SH "RETURN VALUE" +.PP +Returns \fB0\fR on success or \fB-1\fR on failure +.SH "EXAMPLES" +.PP +.PP +.nf +\f(CWint delta_x, delta_y; +SDL_Joystick *joy; +\&. +\&. +\&. +SDL_JoystickUpdate(); +if(SDL_JoystickGetBall(joy, 0, &delta_x, &delta_y)==-1) + printf("TrackBall Read Error! +"); +printf("Trackball Delta- X:%d, Y:%d +", delta_x, delta_y);\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_JoystickNumBalls\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_JoystickGetButton.3 b/docs/man3/SDL_JoystickGetButton.3 new file mode 100644 index 0000000..e7b336b --- /dev/null +++ b/docs/man3/SDL_JoystickGetButton.3 @@ -0,0 +1,18 @@ +.TH "SDL_JoystickGetButton" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_JoystickGetButton \- Get the current state of a given button on a given joystick +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBUint8 \fBSDL_JoystickGetButton\fP\fR(\fBSDL_Joystick *joystick, int button\fR); +.SH "DESCRIPTION" +.PP +SDL_JoystickGetButton returns the current state of the given \fBbutton\fR on the given \fBjoystick\fR\&. +.SH "RETURN VALUE" +.PP +\fB1\fR if the button is pressed\&. Otherwise, \fB0\fR\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_JoystickNumButtons\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_JoystickGetHat.3 b/docs/man3/SDL_JoystickGetHat.3 new file mode 100644 index 0000000..cdbd910 --- /dev/null +++ b/docs/man3/SDL_JoystickGetHat.3 @@ -0,0 +1,36 @@ +.TH "SDL_JoystickGetHat" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_JoystickGetHat \- Get the current state of a joystick hat +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBUint8 \fBSDL_JoystickGetHat\fP\fR(\fBSDL_Joystick *joystick, int hat\fR); +.SH "DESCRIPTION" +.PP +SDL_JoystickGetHat returns the current state of the given \fBhat\fR on the given \fBjoystick\fR\&. +.SH "RETURN VALUE" +.PP +The current state is returned as a Uint8 which is defined as an OR\&'d combination of one or more of the following +.IP "" 10 +\fBSDL_HAT_CENTERED\fP +.IP "" 10 +\fBSDL_HAT_UP\fP +.IP "" 10 +\fBSDL_HAT_RIGHT\fP +.IP "" 10 +\fBSDL_HAT_DOWN\fP +.IP "" 10 +\fBSDL_HAT_LEFT\fP +.IP "" 10 +\fBSDL_HAT_RIGHTUP\fP +.IP "" 10 +\fBSDL_HAT_RIGHTDOWN\fP +.IP "" 10 +\fBSDL_HAT_LEFTUP\fP +.IP "" 10 +\fBSDL_HAT_LEFTDOWN\fP +.SH "SEE ALSO" +.PP +\fI\fBSDL_JoystickNumHats\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_JoystickIndex.3 b/docs/man3/SDL_JoystickIndex.3 new file mode 100644 index 0000000..611e4b6 --- /dev/null +++ b/docs/man3/SDL_JoystickIndex.3 @@ -0,0 +1,18 @@ +.TH "SDL_JoystickIndex" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_JoystickIndex \- Get the index of an SDL_Joystick\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_JoystickIndex\fP\fR(\fBSDL_Joystick *joystick\fR); +.SH "DESCRIPTION" +.PP +Returns the index of a given \fBSDL_Joystick\fR structure\&. +.SH "RETURN VALUE" +.PP +Index number of the joystick\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_JoystickOpen\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_JoystickName.3 b/docs/man3/SDL_JoystickName.3 new file mode 100644 index 0000000..364297e --- /dev/null +++ b/docs/man3/SDL_JoystickName.3 @@ -0,0 +1,32 @@ +.TH "SDL_JoystickName" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_JoystickName \- Get joystick name\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBconst char *\fBSDL_JoystickName\fP\fR(\fBint index\fR); +.SH "DESCRIPTION" +.PP +Get the implementation dependent name of joystick\&. The \fBindex\fR parameter refers to the N\&'th joystick on the system\&. +.SH "RETURN VALUE" +.PP +Returns a char pointer to the joystick name\&. +.SH "EXAMPLES" +.PP +.PP +.nf +\f(CW/* Print the names of all attached joysticks */ +int num_joy, i; +num_joy=SDL_NumJoysticks(); +printf("%d joysticks found +", num_joy); +for(i=0;i0){ + // Open joystick + joy=SDL_JoystickOpen(0); + + if(joy) + { + printf("Opened Joystick 0 +"); + printf("Name: %s +", SDL_JoystickName(0)); + printf("Number of Axes: %d +", SDL_JoystickNumAxes(joy)); + printf("Number of Buttons: %d +", SDL_JoystickNumButtons(joy)); + printf("Number of Balls: %d +", SDL_JoystickNumBalls(joy)); + } + else + printf("Couldn\&'t open Joystick 0 +"); + + // Close if opened + if(SDL_JoystickOpened(0)) + SDL_JoystickClose(joy); +}\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_JoystickClose\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_JoystickOpened.3 b/docs/man3/SDL_JoystickOpened.3 new file mode 100644 index 0000000..9d82e09 --- /dev/null +++ b/docs/man3/SDL_JoystickOpened.3 @@ -0,0 +1,18 @@ +.TH "SDL_JoystickOpened" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_JoystickOpened \- Determine if a joystick has been opened +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_JoystickOpened\fP\fR(\fBint index\fR); +.SH "DESCRIPTION" +.PP +Determines whether a joystick has already been opened within the application\&. \fBindex\fR refers to the N\&'th joystick on the system\&. +.SH "RETURN VALUE" +.PP +Returns \fB1\fR if the joystick has been opened, or \fB0\fR if it has not\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_JoystickOpen\fP\fR, \fI\fBSDL_JoystickClose\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_JoystickUpdate.3 b/docs/man3/SDL_JoystickUpdate.3 new file mode 100644 index 0000000..7d1035b --- /dev/null +++ b/docs/man3/SDL_JoystickUpdate.3 @@ -0,0 +1,15 @@ +.TH "SDL_JoystickUpdate" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_JoystickUpdate \- Updates the state of all joysticks +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_JoystickUpdate\fP\fR(\fBvoid\fR); +.SH "DESCRIPTION" +.PP +Updates the state(position, buttons, etc\&.) of all open joysticks\&. If joystick events have been enabled with \fI\fBSDL_JoystickEventState\fP\fR then this is called automatically in the event loop\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_JoystickEventState\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_KeyboardEvent.3 b/docs/man3/SDL_KeyboardEvent.3 new file mode 100644 index 0000000..4aeea79 --- /dev/null +++ b/docs/man3/SDL_KeyboardEvent.3 @@ -0,0 +1,38 @@ +.TH "SDL_KeyboardEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_KeyboardEvent \- Keyboard event structure +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct{ + Uint8 type; + Uint8 state; + SDL_keysym keysym; +} SDL_KeyboardEvent;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBtype\fR +\fBSDL_KEYDOWN\fP or \fBSDL_KEYUP\fP +.TP 20 +\fBstate\fR +\fBSDL_PRESSED\fP or \fBSDL_RELEASED\fP +.TP 20 +\fBkeysym\fR +Contains key press information +.SH "DESCRIPTION" +.PP +\fBSDL_KeyboardEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_KEYDOWN\fP or \fBSDL_KEYUP\fP is reported\&. +.PP +The \fBtype\fR and \fBstate\fR actually report the same information, they just use different values to do it! A keyboard event occurs when a key is released (\fBtype\fR=\fBSDK_KEYUP\fP or \fBstate\fR=\fBSDL_RELEASED\fP) and when a key is pressed (\fBtype\fR=\fBSDL_KEYDOWN\fP or \fBstate\fR=\fBSDL_PRESSED\fP)\&. The information on what key was pressed or released is in the \fI\fBkeysym\fR\fR structure\&. +.PP +.RS +\fBNote: +.PP +Repeating \fBSDL_KEYDOWN\fP events will occur if key repeat is enabled (see \fI\fBSDL_EnableKeyRepeat\fP\fR)\&. +.RE +.SH "SEE ALSO" +.PP +\fI\fBSDL_Event\fR\fR, \fI\fBSDL_keysym\fR\fR, \fI\fBSDL_EnableKeyRepeat\fP\fR, \fI\fBSDL_EnableUNICODE\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_KillThread.3 b/docs/man3/SDL_KillThread.3 new file mode 100644 index 0000000..2a34f11 --- /dev/null +++ b/docs/man3/SDL_KillThread.3 @@ -0,0 +1,16 @@ +.TH "SDL_KillThread" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_KillThread \- Gracelessly terminates the thread\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +#include "SDL_thread\&.h" +.sp +\fBvoid \fBSDL_KillThread\fP\fR(\fBSDL_Thread *thread\fR); +.SH "DESCRIPTION" +.PP +\fBSDL_KillThread\fP gracelessly terminates the thread associated with \fBthread\fR\&. If possible, you should use some other form of IPC to signal the thread to quit\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_CreateThread\fP\fR, \fI\fBSDL_WaitThread\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_ListModes.3 b/docs/man3/SDL_ListModes.3 new file mode 100644 index 0000000..3cc9376 --- /dev/null +++ b/docs/man3/SDL_ListModes.3 @@ -0,0 +1,53 @@ +.TH "SDL_ListModes" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_ListModes \- Returns a pointer to an array of available screen dimensions for the given format and video flags +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBSDL_Rect **\fBSDL_ListModes\fP\fR(\fBSDL_PixelFormat *format, Uint32 flags\fR); +.SH "DESCRIPTION" +.PP +Return a pointer to an array of available screen dimensions for the given format and video flags, sorted largest to smallest\&. Returns \fBNULL\fP if there are no dimensions available for a particular format, or \fB-1\fR if any dimension is okay for the given format\&. +.PP +If \fBformat\fR is \fBNULL\fP, the mode list will be for the format returned by \fISDL_GetVideoInfo()\fR->\fBvfmt\fR\&. The \fBflag\fR parameter is an OR\&'d combination of \fIsurface\fR flags\&. The flags are the same as those used \fI\fBSDL_SetVideoMode\fP\fR and they play a strong role in deciding what modes are valid\&. For instance, if you pass \fBSDL_HWSURFACE\fP as a flag only modes that support hardware video surfaces will be returned\&. +.SH "EXAMPLE" +.PP +.nf +\f(CWSDL_Rect **modes; +int i; +\&. +\&. +\&. + +/* Get available fullscreen/hardware modes */ +modes=SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE); + +/* Check is there are any modes available */ +if(modes == (SDL_Rect **)0){ + printf("No modes available! +"); + exit(-1); +} + +/* Check if or resolution is restricted */ +if(modes == (SDL_Rect **)-1){ + printf("All resolutions available\&. +"); +} +else{ + /* Print valid modes */ + printf("Available Modes +"); + for(i=0;modes[i];++i) + printf(" %d x %d +", modes[i]->w, modes[i]->h); +} +\&. +\&.\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_GetVideoInfo\fP\fR, \fI\fBSDL_Rect\fR\fR, \fI\fBSDL_PixelFormat\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_LoadBMP.3 b/docs/man3/SDL_LoadBMP.3 new file mode 100644 index 0000000..7e3b4af --- /dev/null +++ b/docs/man3/SDL_LoadBMP.3 @@ -0,0 +1,18 @@ +.TH "SDL_LoadBMP" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_LoadBMP \- Load a Windows BMP file into an SDL_Surface\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBSDL_Surface *\fBSDL_LoadBMP\fP\fR(\fBconst char *file\fR); +.SH "DESCRIPTION" +.PP +Loads a surface from a named Windows BMP file\&. +.SH "RETURN VALUE" +.PP +Returns the new surface, or \fBNULL\fP if there was an error\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_SaveBMP\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_LoadWAV.3 b/docs/man3/SDL_LoadWAV.3 new file mode 100644 index 0000000..490ff67 --- /dev/null +++ b/docs/man3/SDL_LoadWAV.3 @@ -0,0 +1,42 @@ +.TH "SDL_LoadWAV" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_LoadWAV \- Load a WAVE file +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBSDL_AudioSpec *\fBSDL_LoadWAV\fP\fR(\fBconst char *file, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len\fR); +.SH "DESCRIPTION" +.PP +\fBSDL_LoadWAV\fP This function loads a WAVE \fBfile\fR into memory\&. +.PP +If this function succeeds, it returns the given \fI\fBSDL_AudioSpec\fP\fR, filled with the audio data format of the wave data, and sets \fBaudio_buf\fR to a \fBmalloc\fP\&'d buffer containing the audio data, and sets \fBaudio_len\fR to the length of that audio buffer, in bytes\&. You need to free the audio buffer with \fI\fBSDL_FreeWAV\fP\fR when you are done with it\&. +.PP +This function returns \fBNULL\fP and sets the SDL error message if the wave file cannot be opened, uses an unknown data format, or is corrupt\&. Currently raw, MS-ADPCM and IMA-ADPCM WAVE files are supported\&. +.SH "EXAMPLE" +.PP +.nf +\f(CWSDL_AudioSpec wav_spec; +Uint32 wav_length; +Uint8 *wav_buffer; + +/* Load the WAV */ +if( SDL_LoadWAV("test\&.wav", &wav_spec, &wav_buffer, &wav_length) == NULL ){ + fprintf(stderr, "Could not open test\&.wav: %s +", SDL_GetError()); + exit(-1); +} +\&. +\&. +\&. +/* Do stuff with the WAV */ +\&. +\&. +/* Free It */ +SDL_FreeWAV(wav_buffer);\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_AudioSpec\fR\fR, \fI\fBSDL_OpenAudio\fP\fR, \fI\fBSDL_FreeWAV\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_LockAudio.3 b/docs/man3/SDL_LockAudio.3 new file mode 100644 index 0000000..8c141fd --- /dev/null +++ b/docs/man3/SDL_LockAudio.3 @@ -0,0 +1,15 @@ +.TH "SDL_LockAudio" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_LockAudio \- Lock out the callback function +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_LockAudio\fP\fR(\fBvoid\fR) +.SH "DESCRIPTION" +.PP +The lock manipulated by these functions protects the callback function\&. During a LockAudio period, you can be guaranteed that the callback function is not running\&. Do not call these from the callback function or you will cause deadlock\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_OpenAudio\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_LockSurface.3 b/docs/man3/SDL_LockSurface.3 new file mode 100644 index 0000000..6db3ad7 --- /dev/null +++ b/docs/man3/SDL_LockSurface.3 @@ -0,0 +1,48 @@ +.TH "SDL_LockSurface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_LockSurface \- Lock a surface for directly access\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_LockSurface\fP\fR(\fBSDL_Surface *surface\fR); +.SH "DESCRIPTION" +.PP +\fBSDL_LockSurface\fP sets up a surface for directly accessing the pixels\&. Between calls to \fBSDL_LockSurface\fP and \fBSDL_UnlockSurface\fP, you can write to and read from \fBsurface->\fBpixels\fR\fR, using the pixel format stored in \fBsurface->\fBformat\fR\fR\&. Once you are done accessing the surface, you should use \fBSDL_UnlockSurface\fP to release it\&. +.PP +Not all surfaces require locking\&. If \fBSDL_MUSTLOCK\fP(\fBsurface\fR) evaluates to \fB0\fR, then you can read and write to the surface at any time, and the pixel format of the surface will not change\&. +.PP +No operating system or library calls should be made between lock/unlock pairs, as critical system locks may be held during this time\&. +.PP +It should be noted, that since SDL 1\&.1\&.8 surface locks are recursive\&. This means that you can lock a surface multiple times, but each lock must have a match unlock\&. +.PP +.nf +\f(CW \&. + \&. + SDL_LockSurface( surface ); + \&. + /* Surface is locked */ + /* Direct pixel access on surface here */ + \&. + SDL_LockSurface( surface ); + \&. + /* More direct pixel access on surface */ + \&. + SDL_UnlockSurface( surface ); + /* Surface is still locked */ + /* Note: Is versions < 1\&.1\&.8, the surface would have been */ + /* no longer locked at this stage */ + \&. + SDL_UnlockSurface( surface ); + /* Surface is now unlocked */ + \&. + \&.\fR +.fi +.PP +.SH "RETURN VALUE" +.PP +\fBSDL_LockSurface\fP returns \fB0\fR, or \fB-1\fR if the surface couldn\&'t be locked\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_UnlockSurface\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_LockYUVOverlay.3 b/docs/man3/SDL_LockYUVOverlay.3 new file mode 100644 index 0000000..286d96f --- /dev/null +++ b/docs/man3/SDL_LockYUVOverlay.3 @@ -0,0 +1,18 @@ +.TH "SDL_LockYUVOverlay" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_LockYUVOverlay \- Lock an overlay +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_LockYUVOverlay\fP\fR(\fBSDL_Overlay *overlay\fR); +.SH "DESCRIPTION" +.PP +Much the same as \fI\fBSDL_LockSurface\fP\fR, \fBSDL_LockYUVOverlay\fP locks the \fI\fBoverlay\fR\fR for direct access to pixel data\&. +.SH "RETURN VALUE" +.PP +Returns \fB0\fR on success, or \fB-1\fR on an error\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_UnlockYUVOverlay\fP\fR, \fI\fBSDL_CreateYUVOverlay\fP\fR, \fI\fBSDL_Overlay\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_MapRGB.3 b/docs/man3/SDL_MapRGB.3 new file mode 100644 index 0000000..1e4c963 --- /dev/null +++ b/docs/man3/SDL_MapRGB.3 @@ -0,0 +1,22 @@ +.TH "SDL_MapRGB" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_MapRGB \- Map a RGB color value to a pixel format\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBUint32 \fBSDL_MapRGB\fP\fR(\fBSDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b\fR); +.SH "DESCRIPTION" +.PP +Maps the RGB color value to the specified pixel format and returns the pixel value as a 32-bit int\&. +.PP +If the format has a palette (8-bit) the index of the closest matching color in the palette will be returned\&. +.PP +If the specified pixel format has an alpha component it will be returned as all 1 bits (fully opaque)\&. +.SH "RETURN VALUE" +.PP +A pixel value best approximating the given RGB color value for a given pixel format\&. If the pixel format bpp (color depth) is less than 32-bpp then the unused upper bits of the return value can safely be ignored (e\&.g\&., with a 16-bpp format the return value can be assigned to a \fBUint16\fP, and similarly a \fBUint8\fP for an 8-bpp format)\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_GetRGB\fP\fR, \fI\fBSDL_GetRGBA\fP\fR, \fI\fBSDL_MapRGBA\fP\fR, \fI\fBSDL_PixelFormat\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_MapRGBA.3 b/docs/man3/SDL_MapRGBA.3 new file mode 100644 index 0000000..03d78d8 --- /dev/null +++ b/docs/man3/SDL_MapRGBA.3 @@ -0,0 +1,22 @@ +.TH "SDL_MapRGBA" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_MapRGBA \- Map a RGBA color value to a pixel format\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBUint32 \fBSDL_MapRGBA\fP\fR(\fBSDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b, Uint8 a\fR); +.SH "DESCRIPTION" +.PP +Maps the RGBA color value to the specified pixel format and returns the pixel value as a 32-bit int\&. +.PP +If the format has a palette (8-bit) the index of the closest matching color in the palette will be returned\&. +.PP +If the specified pixel format has no alpha component the alpha value will be ignored (as it will be in formats with a palette)\&. +.SH "RETURN VALUE" +.PP +A pixel value best approximating the given RGBA color value for a given pixel format\&. If the pixel format bpp (color depth) is less than 32-bpp then the unused upper bits of the return value can safely be ignored (e\&.g\&., with a 16-bpp format the return value can be assigned to a \fBUint16\fP, and similarly a \fBUint8\fP for an 8-bpp format)\&. +.SH "SEE ALSO" +.PP +\fISDL_GetRGB\fR, \fISDL_GetRGBA\fR, \fISDL_MapRGB\fR, \fISDL_PixelFormat\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_MixAudio.3 b/docs/man3/SDL_MixAudio.3 new file mode 100644 index 0000000..b98660d --- /dev/null +++ b/docs/man3/SDL_MixAudio.3 @@ -0,0 +1,21 @@ +.TH "SDL_MixAudio" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_MixAudio \- Mix audio data +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_MixAudio\fP\fR(\fBUint8 *dst, Uint8 *src, Uint32 len, int volume\fR); +.SH "DESCRIPTION" +.PP +This function takes two audio buffers of \fBlen\fR bytes each of the playing audio format and mixes them, performing addition, volume adjustment, and overflow clipping\&. The \fBvolume\fR ranges from 0 to \fBSDL_MIX_MAXVOLUME\fP and should be set to the maximum value for full audio volume\&. Note this does not change hardware volume\&. This is provided for convenience -- you can mix your own audio data\&. +.PP +.RS +\fBNote: +.PP +Do not use this function for mixing together more than two streams of sample data\&. The output from repeated application of this function may be distorted by clipping, because there is no accumulator with greater range than the input (not to mention this being an inefficient way of doing it)\&. Use mixing functions from SDL_mixer, OpenAL, or write your own mixer instead\&. +.RE +.SH "SEE ALSO" +.PP +\fI\fBSDL_OpenAudio\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_MouseButtonEvent.3 b/docs/man3/SDL_MouseButtonEvent.3 new file mode 100644 index 0000000..d2d34a0 --- /dev/null +++ b/docs/man3/SDL_MouseButtonEvent.3 @@ -0,0 +1,36 @@ +.TH "SDL_MouseButtonEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_MouseButtonEvent \- Mouse button event structure +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct{ + Uint8 type; + Uint8 button; + Uint8 state; + Uint16 x, y; +} SDL_MouseButtonEvent;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBtype\fR +\fBSDL_MOUSEBUTTONDOWN\fP or \fBSDL_MOUSEBUTTONUP\fP +.TP 20 +\fBbutton\fR +The mouse button index (SDL_BUTTON_LEFT, SDL_BUTTON_MIDDLE, SDL_BUTTON_RIGHT) +.TP 20 +\fBstate\fR +\fBSDL_PRESSED\fP or \fBSDL_RELEASED\fP +.TP 20 +\fBx\fR, \fBy\fR +The X/Y coordinates of the mouse at press/release time +.SH "DESCRIPTION" +.PP +\fBSDL_MouseButtonEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_MOUSEBUTTONDOWN\fP or \fBSDL_MOUSEBUTTONUP\fP is reported\&. +.PP +When a mouse button press or release is detected then number of the button pressed (from 1 to 255, with 1 usually being the left button and 2 the right) is placed into \fBbutton\fR, the position of the mouse when this event occured is stored in the \fBx\fR and the \fBy\fR fields\&. Like \fI\fBSDL_KeyboardEvent\fR\fR, information on whether the event was a press or a release event is stored in both the \fBtype\fR and \fBstate\fR fields, but this should be obvious\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_Event\fR\fR, \fI\fBSDL_MouseMotionEvent\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_MouseMotionEvent.3 b/docs/man3/SDL_MouseMotionEvent.3 new file mode 100644 index 0000000..c1b036d --- /dev/null +++ b/docs/man3/SDL_MouseMotionEvent.3 @@ -0,0 +1,38 @@ +.TH "SDL_MouseMotionEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_MouseMotionEvent \- Mouse motion event structure +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct{ + Uint8 type; + Uint8 state; + Uint16 x, y; + Sint16 xrel, yrel; +} SDL_MouseMotionEvent;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBtype\fR +\fBSDL_MOUSEMOTION\fP +.TP 20 +\fBstate\fR +The current button state +.TP 20 +\fBx\fR, \fBy\fR +The X/Y coordinates of the mouse +.TP 20 +\fBxrel\fR, \fByrel\fR +Relative motion in the X/Y direction +.SH "DESCRIPTION" +.PP +\fBSDL_MouseMotionEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_MOUSEMOTION\fP is reported\&. +.PP +Simply put, a \fBSDL_MOUSEMOTION\fP type event occurs when a user moves the mouse within the application window or when \fI\fBSDL_WarpMouse\fP\fR is called\&. Both the absolute (\fBx\fR and \fBy\fR) and relative (\fBxrel\fR and \fByrel\fR) coordinates are reported along with the current button states (\fBstate\fR)\&. The button state can be interpreted using the \fBSDL_BUTTON\fP macro (see \fI\fBSDL_GetMouseState\fP\fR)\&. +.PP +If the cursor is hidden (\fI\fBSDL_ShowCursor\fP(0)\fR) and the input is grabbed (\fI\fBSDL_WM_GrabInput\fP(SDL_GRAB_ON)\fR), then the mouse will give relative motion events even when the cursor reaches the edge fo the screen\&. This is currently only implemented on Windows and Linux/Unix-a-likes\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_Event\fR\fR, \fI\fBSDL_MouseButtonEvent\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_NumJoysticks.3 b/docs/man3/SDL_NumJoysticks.3 new file mode 100644 index 0000000..c737a1c --- /dev/null +++ b/docs/man3/SDL_NumJoysticks.3 @@ -0,0 +1,18 @@ +.TH "SDL_NumJoysticks" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_NumJoysticks \- Count available joysticks\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_NumJoysticks\fP\fR(\fBvoid\fR); +.SH "DESCRIPTION" +.PP +Counts the number of joysticks attached to the system\&. +.SH "RETURN VALUE" +.PP +Returns the number of attached joysticks +.SH "SEE ALSO" +.PP +\fI\fBSDL_JoystickName\fP\fR, \fI\fBSDL_JoystickOpen\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_OpenAudio.3 b/docs/man3/SDL_OpenAudio.3 new file mode 100644 index 0000000..38a232c --- /dev/null +++ b/docs/man3/SDL_OpenAudio.3 @@ -0,0 +1,97 @@ +.TH "SDL_OpenAudio" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_OpenAudio \- Opens the audio device with the desired parameters\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_OpenAudio\fP\fR(\fBSDL_AudioSpec *desired, SDL_AudioSpec *obtained\fR); +.SH "DESCRIPTION" +.PP +This function opens the audio device with the \fBdesired\fR parameters, and returns 0 if successful, placing the actual hardware parameters in the structure pointed to by \fBobtained\fR\&. If \fBobtained\fR is NULL, the audio data passed to the callback function will be guaranteed to be in the requested format, and will be automatically converted to the hardware audio format if necessary\&. This function returns -1 if it failed to open the audio device, or couldn\&'t set up the audio thread\&. +.PP +To open the audio device a \fBdesired\fR \fI\fBSDL_AudioSpec\fR\fR must be created\&. +.PP +.nf +\f(CWSDL_AudioSpec *desired; +\&. +\&. +desired=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec));\fR +.fi +.PP + You must then fill this structure with your desired audio specifications\&. +.IP "\fBdesired\fR->\fBfreq\fR" 10The desired audio frequency in samples-per-second\&. +.IP "\fBdesired\fR->\fBformat\fR" 10The desired audio format (see \fI\fBSDL_AudioSpec\fR\fR) +.IP "\fBdesired\fR->\fBsamples\fR" 10The desired size of the audio buffer in samples\&. This number should be a power of two, and may be adjusted by the audio driver to a value more suitable for the hardware\&. Good values seem to range between 512 and 8192 inclusive, depending on the application and CPU speed\&. Smaller values yield faster response time, but can lead to underflow if the application is doing heavy processing and cannot fill the audio buffer in time\&. A stereo sample consists of both right and left channels in LR ordering\&. Note that the number of samples is directly related to time by the following formula: ms = (samples*1000)/freq +.IP "\fBdesired\fR->\fBcallback\fR" 10This should be set to a function that will be called when the audio device is ready for more data\&. It is passed a pointer to the audio buffer, and the length in bytes of the audio buffer\&. This function usually runs in a separate thread, and so you should protect data structures that it accesses by calling \fI\fBSDL_LockAudio\fP\fR and \fI\fBSDL_UnlockAudio\fP\fR in your code\&. The callback prototype is: +.PP +.nf +\f(CWvoid callback(void *userdata, Uint8 *stream, int len);\fR +.fi +.PP + \fBuserdata\fR is the pointer stored in \fBuserdata\fR field of the \fBSDL_AudioSpec\fR\&. \fBstream\fR is a pointer to the audio buffer you want to fill with information and \fBlen\fR is the length of the audio buffer in bytes\&. +.IP "\fBdesired\fR->\fBuserdata\fR" 10This pointer is passed as the first parameter to the \fBcallback\fP function\&. +.PP +\fBSDL_OpenAudio\fP reads these fields from the \fBdesired\fR \fBSDL_AudioSpec\fR structure pass to the function and attempts to find an audio configuration matching your \fBdesired\fR\&. As mentioned above, if the \fBobtained\fR parameter is \fBNULL\fP then SDL with convert from your \fBdesired\fR audio settings to the hardware settings as it plays\&. +.PP +If \fBobtained\fR is \fBNULL\fP then the \fBdesired\fR \fBSDL_AudioSpec\fR is your working specification, otherwise the \fBobtained\fR \fBSDL_AudioSpec\fR becomes the working specification and the \fBdesirec\fR specification can be deleted\&. The data in the working specification is used when building \fBSDL_AudioCVT\fR\&'s for converting loaded data to the hardware format\&. +.PP +\fBSDL_OpenAudio\fP calculates the \fBsize\fR and \fBsilence\fR fields for both the \fBdesired\fR and \fBobtained\fR specifications\&. The \fBsize\fR field stores the total size of the audio buffer in bytes, while the \fBsilence\fR stores the value used to represent silence in the audio buffer +.PP +The audio device starts out playing \fBsilence\fR when it\&'s opened, and should be enabled for playing by calling \fI\fBSDL_PauseAudio\fP(\fB0\fR)\fR when you are ready for your audio \fBcallback\fR function to be called\&. Since the audio driver may modify the requested \fBsize\fR of the audio buffer, you should allocate any local mixing buffers after you open the audio device\&. +.SH "EXAMPLES" +.PP +.nf +\f(CW/* Prototype of our callback function */ +void my_audio_callback(void *userdata, Uint8 *stream, int len); + +/* Open the audio device */ +SDL_AudioSpec *desired, *obtained; +SDL_AudioSpec *hardware_spec; + +/* Allocate a desired SDL_AudioSpec */ +desired=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec)); + +/* Allocate space for the obtained SDL_AudioSpec */ +obtained=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec)); + +/* 22050Hz - FM Radio quality */ +desired->freq=22050; + +/* 16-bit signed audio */ +desired->format=AUDIO_S16LSB; + +/* Mono */ +desired->channels=0; + +/* Large audio buffer reduces risk of dropouts but increases response time */ +desired->samples=8192; + +/* Our callback function */ +desired->callback=my_audio_callback; + +desired->userdata=NULL; + +/* Open the audio device */ +if ( SDL_OpenAudio(desired, obtained) < 0 ){ + fprintf(stderr, "Couldn\&'t open audio: %s +", SDL_GetError()); + exit(-1); +} +/* desired spec is no longer needed */ +free(desired); +hardware_spec=obtained; +\&. +\&. +/* Prepare callback for playing */ +\&. +\&. +\&. +/* Start playing */ +SDL_PauseAudio(0);\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_AudioSpec\fP\fR, \fI\fBSDL_LockAudio\fP\fR, \fI\fBSDL_UnlockAudio\fP\fR, \fI\fBSDL_PauseAudio\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_Overlay.3 b/docs/man3/SDL_Overlay.3 new file mode 100644 index 0000000..a852e91 --- /dev/null +++ b/docs/man3/SDL_Overlay.3 @@ -0,0 +1,52 @@ +.TH "SDL_Overlay" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_Overlay \- YUV video overlay +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct{ + Uint32 format; + int w, h; + int planes; + Uint16 *pitches; + Uint8 **pixels; + Uint32 hw_overlay:1; +} SDL_Overlay;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBformat\fR +Overlay format (see below) +.TP 20 +\fBw, h\fR +Width and height of overlay +.TP 20 +\fBplanes\fR +Number of planes in the overlay\&. Usually either 1 or 3 +.TP 20 +\fBpitches\fR +An array of pitches, one for each plane\&. Pitch is the length of a row in bytes\&. +.TP 20 +\fBpixels\fR +An array of pointers to teh data of each plane\&. The overlay should be locked before these pointers are used\&. +.TP 20 +\fBhw_overlay\fR +This will be set to 1 if the overlay is hardware accelerated\&. +.SH "DESCRIPTION" +.PP +A \fBSDL_Overlay\fR is similar to a \fI\fBSDL_Surface\fR\fR except it stores a YUV overlay\&. All the fields are read only, except for \fBpixels\fR which should be \fIlocked\fR before use\&. The \fBformat\fR field stores the format of the overlay which is one of the following: +.PP +.nf +\f(CW#define SDL_YV12_OVERLAY 0x32315659 /* Planar mode: Y + V + U */ +#define SDL_IYUV_OVERLAY 0x56555949 /* Planar mode: Y + U + V */ +#define SDL_YUY2_OVERLAY 0x32595559 /* Packed mode: Y0+U0+Y1+V0 */ +#define SDL_UYVY_OVERLAY 0x59565955 /* Packed mode: U0+Y0+V0+Y1 */ +#define SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 */\fR +.fi +.PP + More information on YUV formats can be found at \fIhttp://www\&.webartz\&.com/fourcc/indexyuv\&.htm (link to URL http://www.webartz.com/fourcc/indexyuv.htm) \fR\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_CreateYUVOverlay\fP\fR, \fI\fBSDL_LockYUVOverlay\fP\fR, \fI\fBSDL_UnlockYUVOverlay\fP\fR, \fI\fBSDL_FreeYUVOverlay\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_Palette.3 b/docs/man3/SDL_Palette.3 new file mode 100644 index 0000000..ea5e406 --- /dev/null +++ b/docs/man3/SDL_Palette.3 @@ -0,0 +1,26 @@ +.TH "SDL_Palette" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_Palette \- Color palette for 8-bit pixel formats +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct{ + int ncolors; + SDL_Color *colors; +} SDL_Palette;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBncolors\fR +Number of colors used in this palette +.TP 20 +\fBcolors\fR +Pointer to \fI\fBSDL_Color\fR\fR structures that make up the palette\&. +.SH "DESCRIPTION" +.PP +Each pixel in an 8-bit surface is an index into the \fBcolors\fR field of the \fBSDL_Palette\fR structure store in \fI\fBSDL_PixelFormat\fR\fR\&. A \fBSDL_Palette\fR should never need to be created manually\&. It is automatically created when SDL allocates a \fBSDL_PixelFormat\fR for a surface\&. The colors values of a \fI\fBSDL_Surface\fR\fRs palette can be set with the \fI\fBSDL_SetColors\fP\fR\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_Color\fR\fR, \fI\fBSDL_Surface\fR\fR, \fI\fBSDL_SetColors\fP\fR \fI\fBSDL_SetPalette\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_PauseAudio.3 b/docs/man3/SDL_PauseAudio.3 new file mode 100644 index 0000000..1ca979a --- /dev/null +++ b/docs/man3/SDL_PauseAudio.3 @@ -0,0 +1,15 @@ +.TH "SDL_PauseAudio" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_PauseAudio \- Pauses and unpauses the audio callback processing +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_PauseAudio\fP\fR(\fBint pause_on\fR); +.SH "DESCRIPTION" +.PP +This function pauses and unpauses the audio callback processing\&. It should be called with \fBpause_on\fR=0 after opening the audio device to start playing sound\&. This is so you can safely initialize data for your callback function after opening the audio device\&. Silence will be written to the audio device during the pause\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_GetAudioStatus\fP\fR, \fI\fBSDL_OpenAudio\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_PeepEvents.3 b/docs/man3/SDL_PeepEvents.3 new file mode 100644 index 0000000..016542d --- /dev/null +++ b/docs/man3/SDL_PeepEvents.3 @@ -0,0 +1,26 @@ +.TH "SDL_PeepEvents" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_PeepEvents \- Checks the event queue for messages and optionally returns them\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_PeepEvents\fP\fR(\fBSDL_Event *events, int numevents, SDL_eventaction action, Uint32 mask\fR); +.SH "DESCRIPTION" +.PP +Checks the event queue for messages and optionally returns them\&. +.PP +If \fBaction\fR is \fBSDL_ADDEVENT\fP, up to \fBnumevents\fR events will be added to the back of the event queue\&. +.PP +If \fBaction\fR is \fBSDL_PEEKEVENT\fP, up to \fBnumevents\fR events at the front of the event queue, matching \fI\fBmask\fR\fR, will be returned and will not be removed from the queue\&. +.PP +If \fBaction\fR is \fBSDL_GETEVENT\fP, up to \fBnumevents\fR events at the front of the event queue, matching \fI\fBmask\fR\fR, will be returned and will be removed from the queue\&. +.PP +This function is thread-safe\&. +.SH "RETURN VALUE" +.PP +This function returns the number of events actually stored, or \fB-1\fR if there was an error\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_Event\fR\fR, \fI\fBSDL_PollEvent\fP\fR, \fI\fBSDL_PushEvent\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_PixelFormat.3 b/docs/man3/SDL_PixelFormat.3 new file mode 100644 index 0000000..f91593e --- /dev/null +++ b/docs/man3/SDL_PixelFormat.3 @@ -0,0 +1,140 @@ +.TH "SDL_PixelFormat" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_PixelFormat \- Stores surface format information +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct SDL_PixelFormat { + SDL_Palette *palette; + Uint8 BitsPerPixel; + Uint8 BytesPerPixel; + Uint8 Rloss, Gloss, Bloss, Aloss; + Uint8 Rshift, Gshift, Bshift, Ashift; + Uint32 Rmask, Gmask, Bmask, Amask; + Uint32 colorkey; + Uint8 alpha; +} SDL_PixelFormat;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBpalette\fR +Pointer to the \fIpalette\fR, or \fBNULL\fP if the \fBBitsPerPixel\fR>8 +.TP 20 +\fBBitsPerPixel\fR +The number of bits used to represent each pixel in a surface\&. Usually 8, 16, 24 or 32\&. +.TP 20 +\fBBytesPerPixel\fR +The number of bytes used to represent each pixel in a surface\&. Usually one to four\&. +.TP 20 +\fB[RGBA]mask\fR +Binary mask used to retrieve individual color values +.TP 20 +\fB[RGBA]loss\fR +Precision loss of each color component (2^[RGBA]loss) +.TP 20 +\fB[RGBA]shift\fR +Binary left shift of each color component in the pixel value +.TP 20 +\fBcolorkey\fR +Pixel value of transparent pixels +.TP 20 +\fBalpha\fR +Overall surface alpha value +.SH "DESCRIPTION" +.PP +A \fBSDL_PixelFormat\fR describes the format of the pixel data stored at the \fBpixels\fR field of a \fI\fBSDL_Surface\fR\fR\&. Every surface stores a \fBSDL_PixelFormat\fR in the \fBformat\fR field\&. +.PP +If you wish to do pixel level modifications on a surface, then understanding how SDL stores its color information is essential\&. +.PP +8-bit pixel formats are the easiest to understand\&. Since its an 8-bit format, we have 8 \fBBitsPerPixel\fR and 1 \fBBytesPerPixel\fR\&. Since \fBBytesPerPixel\fR is 1, all pixels are represented by a Uint8 which contains an index into \fBpalette\fR->\fBcolors\fR\&. So, to determine the color of a pixel in a 8-bit surface: we read the color index from \fBsurface\fR->\fBpixels\fR and we use that index to read the \fI\fBSDL_Color\fR\fR structure from \fBsurface\fR->\fBformat\fR->\fBpalette\fR->\fBcolors\fR\&. Like so: +.PP +.nf +\f(CWSDL_Surface *surface; +SDL_PixelFormat *fmt; +SDL_Color *color; +Uint8 index; + +\&. +\&. + +/* Create surface */ +\&. +\&. +fmt=surface->format; + +/* Check the bitdepth of the surface */ +if(fmt->BitsPerPixel!=8){ + fprintf(stderr, "Not an 8-bit surface\&. +"); + return(-1); +} + +/* Lock the surface */ +SDL_LockSurface(surface); + +/* Get the topleft pixel */ +index=*(Uint8 *)surface->pixels; +color=fmt->palette->colors[index]; + +/* Unlock the surface */ +SDL_UnlockSurface(surface); +printf("Pixel Color-> Red: %d, Green: %d, Blue: %d\&. Index: %d +", + color->r, color->g, color->b, index); +\&. +\&.\fR +.fi +.PP +.PP +Pixel formats above 8-bit are an entirely different experience\&. They are considered to be "TrueColor" formats and the color information is stored in the pixels themselves, not in a palette\&. The mask, shift and loss fields tell us how the color information is encoded\&. The mask fields allow us to isolate each color component, the shift fields tell us the number of bits to the right of each component in the pixel value and the loss fields tell us the number of bits lost from each component when packing 8-bit color component in a pixel\&. +.PP +.nf +\f(CW/* Extracting color components from a 32-bit color value */ +SDL_PixelFormat *fmt; +SDL_Surface *surface; +Uint32 temp, pixel; +Uint8 red, green, blue, alpha; +\&. +\&. +\&. +fmt=surface->format; +SDL_LockSurface(surface); +pixel=*((Uint32*)surface->pixels); +SDL_UnlockSurface(surface); + +/* Get Red component */ +temp=pixel&fmt->Rmask; /* Isolate red component */ +temp=temp>>fmt->Rshift;/* Shift it down to 8-bit */ +temp=temp<Rloss; /* Expand to a full 8-bit number */ +red=(Uint8)temp; + +/* Get Green component */ +temp=pixel&fmt->Gmask; /* Isolate green component */ +temp=temp>>fmt->Gshift;/* Shift it down to 8-bit */ +temp=temp<Gloss; /* Expand to a full 8-bit number */ +green=(Uint8)temp; + +/* Get Blue component */ +temp=pixel&fmt->Bmask; /* Isolate blue component */ +temp=temp>>fmt->Bshift;/* Shift it down to 8-bit */ +temp=temp<Bloss; /* Expand to a full 8-bit number */ +blue=(Uint8)temp; + +/* Get Alpha component */ +temp=pixel&fmt->Amask; /* Isolate alpha component */ +temp=temp>>fmt->Ashift;/* Shift it down to 8-bit */ +temp=temp<Aloss; /* Expand to a full 8-bit number */ +alpha=(Uint8)temp; + +printf("Pixel Color -> R: %d, G: %d, B: %d, A: %d +", red, green, blue, alpha); +\&. +\&. +\&.\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_Surface\fR\fR, \fI\fBSDL_MapRGB\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_PollEvent.3 b/docs/man3/SDL_PollEvent.3 new file mode 100644 index 0000000..6197f7e --- /dev/null +++ b/docs/man3/SDL_PollEvent.3 @@ -0,0 +1,44 @@ +.TH "SDL_PollEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_PollEvent \- Polls for currently pending events\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_PollEvent\fP\fR(\fBSDL_Event *event\fR); +.SH "DESCRIPTION" +.PP +Polls for currently pending events, and returns \fB1\fR if there are any pending events, or \fB0\fR if there are none available\&. +.PP +If \fBevent\fR is not \fBNULL\fP, the next event is removed from the queue and stored in that area\&. +.SH "EXAMPLES" +.PP +.PP +.nf +\f(CWSDL_Event event; /* Event structure */ + +\&. +\&. +\&. +/* Check for events */ +while(SDL_PollEvent(&event)){ /* Loop until there are no events left on the queue */ + switch(event\&.type){ /* Process the appropiate event type */ + case SDL_KEYDOWN: /* Handle a KEYDOWN event */ + printf("Oh! Key press +"); + break; + case SDL_MOUSEMOTION: + \&. + \&. + \&. + default: /* Report an unhandled event */ + printf("I don\&'t know what this event is! +"); + } +}\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_Event\fR\fR, \fI\fBSDL_WaitEvent\fP\fR, \fI\fBSDL_PeepEvents\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_PumpEvents.3 b/docs/man3/SDL_PumpEvents.3 new file mode 100644 index 0000000..62cc13d --- /dev/null +++ b/docs/man3/SDL_PumpEvents.3 @@ -0,0 +1,23 @@ +.TH "SDL_PumpEvents" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_PumpEvents \- Pumps the event loop, gathering events from the input devices\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_PumpEvents\fP\fR(\fBvoid\fR); +.SH "DESCRIPTION" +.PP +Pumps the event loop, gathering events from the input devices\&. +.PP +\fBSDL_PumpEvents\fP gathers all the pending input information from devices and places it on the event queue\&. Without calls to \fBSDL_PumpEvents\fP no events would ever be placed on the queue\&. Often calls the need for \fBSDL_PumpEvents\fP is hidden from the user since \fI\fBSDL_PollEvent\fP\fR and \fI\fBSDL_WaitEvent\fP\fR implicitly call \fBSDL_PumpEvents\fP\&. However, if you are not polling or waiting for events (e\&.g\&. your filtering them), then you must call \fBSDL_PumpEvents\fP to force an event queue update\&. +.PP +.RS +\fBNote: +.PP +You can only call this function in the thread that set the video mode\&. +.RE +.SH "SEE ALSO" +.PP +\fI\fBSDL_PollEvent\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_PushEvent.3 b/docs/man3/SDL_PushEvent.3 new file mode 100644 index 0000000..4be188f --- /dev/null +++ b/docs/man3/SDL_PushEvent.3 @@ -0,0 +1,27 @@ +.TH "SDL_PushEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_PushEvent \- Pushes an event onto the event queue +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_PushEvent\fP\fR(\fBSDL_Event *event\fR); +.SH "DESCRIPTION" +.PP +The event queue can actually be used as a two way communication channel\&. Not only can events be read from the queue, but the user can also push their own events onto it\&. \fBevent\fR is a pointer to the event structure you wish to push onto the queue\&. +.PP +.RS +\fBNote: +.PP +Pushing device input events onto the queue doesn\&'t modify the state of the device within SDL\&. +.RE +.SH "RETURN VALUE" +.PP +Returns \fB0\fR on success or \fB-1\fR if the event couldn\&'t be pushed\&. +.SH "EXAMPLES" +.PP +See \fI\fBSDL_Event\fR\fR\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_PollEvent\fP\fR, \fI\fBSDL_PeepEvents\fP\fR, \fI\fBSDL_Event\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_Quit.3 b/docs/man3/SDL_Quit.3 new file mode 100644 index 0000000..42fe8c1 --- /dev/null +++ b/docs/man3/SDL_Quit.3 @@ -0,0 +1,29 @@ +.TH "SDL_Quit" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_Quit \- Shut down SDL +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_Quit\fP\fR(\fBvoid\fR); +.SH "DESCRIPTION" +.PP +\fBSDL_Quit\fP shuts down all SDL subsystems and frees the resources allocated to them\&. This should always be called before you exit\&. For the sake of simplicity you can set \fBSDL_Quit\fP as your \fBatexit\fP call, like: +.PP +.nf +\f(CWSDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO); +atexit(SDL_Quit); +\&. +\&.\fR +.fi +.PP +.PP +.RS +\fBNote: +.PP +While using \fBatexit\fP maybe be fine for small programs, more advanced users should shut down SDL in their own cleanup code\&. Plus, using \fBatexit\fP in a library is a sure way to crash dynamically loaded code +.RE +.SH "SEE ALSO" +.PP +\fI\fBSDL_QuitSubsystem\fP\fR, \fI\fBSDL_Init\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_QuitEvent.3 b/docs/man3/SDL_QuitEvent.3 new file mode 100644 index 0000000..c357e2a --- /dev/null +++ b/docs/man3/SDL_QuitEvent.3 @@ -0,0 +1,30 @@ +.TH "SDL_QuitEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_QuitEvent \- Quit requested event +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct{ + Uint8 type +} SDL_QuitEvent;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBtype\fR +\fBSDL_QUIT\fP +.SH "DESCRIPTION" +.PP +\fBSDL_QuitEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used whan an event of type \fBSDL_QUIT\fP is reported\&. +.PP +As can be seen, the SDL_QuitEvent structure serves no useful purpose\&. The event itself, on the other hand, is very important\&. If you filter out or ignore a quit event then it is impossible for the user to close the window\&. On the other hand, if you do accept a quit event then the application window will be closed, and screen updates will still report success event though the application will no longer be visible\&. +.PP +.RS +\fBNote: +.PP +The macro \fBSDL_QuitRequested\fP will return non-zero if a quit event is pending +.RE +.SH "SEE ALSO" +.PP +\fI\fBSDL_Event\fR\fR, \fI\fBSDL_SetEventFilter\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_QuitSubSystem.3 b/docs/man3/SDL_QuitSubSystem.3 new file mode 100644 index 0000000..79e3ca5 --- /dev/null +++ b/docs/man3/SDL_QuitSubSystem.3 @@ -0,0 +1,15 @@ +.TH "SDL_QuitSubSystem" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_QuitSubSystem \- Shut down a subsystem +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_QuitSubSystem\fP\fR(\fBUint32 flags\fR); +.SH "DESCRIPTION" +.PP +\fBSDL_QuitSubSystem\fP allows you to shut down a subsystem that has been previously initialized by \fI\fBSDL_Init\fP\fR or \fI\fBSDL_InitSubSystem\fP\fR\&. The \fBflags\fR tells \fBSDL_QuitSubSystem\fP which subsystems to shut down, it uses the same values that are passed to \fI\fBSDL_Init\fP\fR\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_Quit\fP\fR, \fI\fBSDL_Init\fP\fR, \fI\fBSDL_InitSubSystem\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_RWFromFile.3 b/docs/man3/SDL_RWFromFile.3 new file mode 100644 index 0000000..9ea68b9 --- /dev/null +++ b/docs/man3/SDL_RWFromFile.3 @@ -0,0 +1,18 @@ +.TH "SDL_FunctionName" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_FunctionName \- Short description of function +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBreturn type\fBSDL_FunctionName\fP\fR(\fBparameter\fR); +.SH "DESCRIPTION" +.PP +Full description +.SH "EXAMPLES" +.PP +examples here +.SH "SEE ALSO" +.PP +\fISDL_AnotherFunction\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_Rect.3 b/docs/man3/SDL_Rect.3 new file mode 100644 index 0000000..8db224d --- /dev/null +++ b/docs/man3/SDL_Rect.3 @@ -0,0 +1,26 @@ +.TH "SDL_Rect" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_Rect \- Defines a rectangular area +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct{ + Sint16 x, y; + Uint16 w, h; +} SDL_Rect;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBx, y\fR +Position of the upper-left corner of the rectangle +.TP 20 +\fBw, h\fR +The width and height of the rectangle +.SH "DESCRIPTION" +.PP +A \fBSDL_Rect\fR defines a rectangular area of pixels\&. It is used by \fI\fBSDL_BlitSurface\fP\fR to define blitting regions and by several other video functions\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_BlitSurface\fP\fR, \fI\fBSDL_UpdateRect\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_RemoveTimer.3 b/docs/man3/SDL_RemoveTimer.3 new file mode 100644 index 0000000..1203c6f --- /dev/null +++ b/docs/man3/SDL_RemoveTimer.3 @@ -0,0 +1,25 @@ +.TH "SDL_RemoveTimer" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_RemoveTimer \- Remove a timer which was added with \fISDL_AddTimer\fR\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBSDL_bool \fBSDL_RemoveTimer\fP\fR(\fBSDL_TimerID id\fR); +.SH "DESCRIPTION" +.PP +Removes a timer callback previously added with \fISDL_AddTimer\fR\&. +.SH "RETURN VALUE" +.PP +Returns a boolean value indicating success\&. +.SH "EXAMPLES" +.PP +.PP +.nf +\f(CWSDL_RemoveTimer(my_timer_id);\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_AddTimer\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_ResizeEvent.3 b/docs/man3/SDL_ResizeEvent.3 new file mode 100644 index 0000000..7b0a5e2 --- /dev/null +++ b/docs/man3/SDL_ResizeEvent.3 @@ -0,0 +1,28 @@ +.TH "SDL_ResizeEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_ResizeEvent \- Window resize event structure +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct{ + Uint8 type; + int w, h; +} SDL_ResizeEvent;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBtype\fR +\fBSDL_VIDEORESIZE\fP +.TP 20 +\fBw\fR, \fBh\fR +New width and height of the window +.SH "DESCRIPTION" +.PP +\fBSDL_ResizeEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_VIDEORESIZE\fP is reported\&. +.PP +When \fBSDL_RESIZABLE\fP is passed as a \fBflag\fR to \fI\fBSDL_SetVideoMode\fP\fR the user is allowed to resize the applications window\&. When the window is resized an \fBSDL_VIDEORESIZE\fP is report, with the new window width and height values stored in \fBw\fR and \fBh\fR, respectively\&. When an \fBSDL_VIDEORESIZE\fP is received the window should be resized to the new dimensions using \fI\fBSDL_SetVideoMode\fP\fR\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_Event\fR\fR, \fI\fBSDL_SetVideoMode\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_SaveBMP.3 b/docs/man3/SDL_SaveBMP.3 new file mode 100644 index 0000000..61e00dd --- /dev/null +++ b/docs/man3/SDL_SaveBMP.3 @@ -0,0 +1,18 @@ +.TH "SDL_SaveBMP" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_SaveBMP \- Save an SDL_Surface as a Windows BMP file\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_SaveBMP\fP\fR(\fBSDL_Surface *surface, const char *file\fR); +.SH "DESCRIPTION" +.PP +Saves the \fBSDL_Surface\fR \fBsurface\fR as a Windows BMP file named \fBfile\fR\&. +.SH "RETURN VALUE" +.PP +Returns \fB0\fR if successful or \fB-1\fR if there was an error\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_LoadBMP\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_SemPost.3 b/docs/man3/SDL_SemPost.3 new file mode 100644 index 0000000..5487d2d --- /dev/null +++ b/docs/man3/SDL_SemPost.3 @@ -0,0 +1,28 @@ +.TH "SDL_SemPost" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_SemPost \- Unlock a semaphore\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +#include "SDL_thread\&.h" +.sp +\fBint \fBSDL_SemPost\fP\fR(\fBSDL_sem *sem\fR); +.SH "DESCRIPTION" +.PP +\fBSDL_SemPost\fP unlocks the semaphore pointed to by \fBsem\fR and atomically increments the semaphores value\&. Threads that were blocking on the semaphore may be scheduled after this call succeeds\&. +.PP +\fBSDL_SemPost\fP should be called after a semaphore is locked by a successful call to \fISDL_SemWait\fR, \fISDL_SemTryWait\fR or \fISDL_SemWaitTimeout\fR\&. +.SH "RETURN VALUE" +.PP +Returns \fB0\fR if successful or \fB-1\fR if there was an error (leaving the semaphore unchanged)\&. +.SH "EXAMPLES" +.PP +.PP +.nf +\f(CWSDL_SemPost(my_sem);\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_CreateSemaphore\fP\fR, \fI\fBSDL_DestroySemaphore\fP\fR, \fI\fBSDL_SemWait\fP\fR, \fI\fBSDL_SemTryWait\fP\fR, \fI\fBSDL_SemWaitTimeout\fP\fR, \fI\fBSDL_SemValue\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_SemTryWait.3 b/docs/man3/SDL_SemTryWait.3 new file mode 100644 index 0000000..aee9aff --- /dev/null +++ b/docs/man3/SDL_SemTryWait.3 @@ -0,0 +1,41 @@ +.TH "SDL_SemTryWait" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_SemTryWait \- Attempt to lock a semaphore but don\&'t suspend the thread\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +#include "SDL_thread\&.h" +.sp +\fBint \fBSDL_SemTryWait\fP\fR(\fBSDL_sem *sem\fR); +.SH "DESCRIPTION" +.PP +\fBSDL_SemTryWait\fP is a non-blocking varient of \fI\fBSDL_SemWait\fP\fR\&. If the value of the semaphore pointed to by \fBsem\fR is positive it will atomically decrement the semaphore value and return 0, otherwise it will return \fBSDL_MUTEX_TIMEOUT\fR instead of suspending the thread\&. +.PP +After \fBSDL_SemTryWait\fP is successful, the semaphore can be released and its count atomically incremented by a successful call to \fISDL_SemPost\fR\&. +.SH "RETURN VALUE" +.PP +Returns \fB0\fR if the semaphore was successfully locked or either \fBSDL_MUTEX_TIMEOUT\fR or \fB-1\fR if the thread would have suspended or there was an error, respectivly\&. +.PP +If the semaphore was not successfully locked, the semaphore will be unchanged\&. +.SH "EXAMPLES" +.PP +.PP +.nf +\f(CWres = SDL_SemTryWait(my_sem); + +if (res == SDL_MUTEX_TIMEOUT) { + return TRY_AGAIN; +} +if (res == -1) { + return WAIT_ERROR; +} + +\&.\&.\&. + +SDL_SemPost(my_sem);\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_CreateSemaphore\fP\fR, \fI\fBSDL_DestroySemaphore\fP\fR, \fI\fBSDL_SemWait\fP\fR, \fI\fBSDL_SemWaitTimeout\fP\fR, \fI\fBSDL_SemPost\fP\fR, \fI\fBSDL_SemValue\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_SemValue.3 b/docs/man3/SDL_SemValue.3 new file mode 100644 index 0000000..0703143 --- /dev/null +++ b/docs/man3/SDL_SemValue.3 @@ -0,0 +1,26 @@ +.TH "SDL_SemValue" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_SemValue \- Return the current value of a semaphore\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +#include "SDL/SDL_thread\&.h" +.sp +\fBUint32 \fBSDL_SemValue\fP\fR(\fBSDL_sem *sem\fR); +.SH "DESCRIPTION" +.PP +\fBSDL_SemValue()\fP returns the current semaphore value from the semaphore pointed to by \fBsem\fR\&. +.SH "RETURN VALUE" +.PP +Returns current value of the semaphore\&. +.SH "EXAMPLES" +.PP +.PP +.nf +\f(CW sem_value = SDL_SemValue(my_sem);\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_CreateSemaphore\fP\fR, \fI\fBSDL_DestroySemaphore\fP\fR, \fI\fBSDL_SemWait\fP\fR, \fI\fBSDL_SemTryWait\fP\fR, \fI\fBSDL_SemWaitTimeout\fP\fR, \fI\fBSDL_SemPost\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_SemWait.3 b/docs/man3/SDL_SemWait.3 new file mode 100644 index 0000000..b7bba3f --- /dev/null +++ b/docs/man3/SDL_SemWait.3 @@ -0,0 +1,34 @@ +.TH "SDL_SemWait" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_SemWait \- Lock a semaphore and suspend the thread if the semaphore value is zero\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +#include "SDL_thread\&.h" +.sp +\fBint \fBSDL_SemWait\fP\fR(\fBSDL_sem *sem\fR); +.SH "DESCRIPTION" +.PP +\fBSDL_SemWait()\fP suspends the calling thread until either the semaphore pointed to by \fBsem\fR has a positive value, the call is interrupted by a signal or error\&. If the call is successful it will atomically decrement the semaphore value\&. +.PP +After \fBSDL_SemWait()\fP is successful, the semaphore can be released and its count atomically incremented by a successful call to \fISDL_SemPost\fR\&. +.SH "RETURN VALUE" +.PP +Returns \fB0\fR if successful or \fB-1\fR if there was an error (leaving the semaphore unchanged)\&. +.SH "EXAMPLES" +.PP +.PP +.nf +\f(CWif (SDL_SemWait(my_sem) == -1) { + return WAIT_FAILED; +} + +\&.\&.\&. + +SDL_SemPost(my_sem);\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_CreateSemaphore\fP\fR, \fI\fBSDL_DestroySemaphore\fP\fR, \fI\fBSDL_SemTryWait\fP\fR, \fI\fBSDL_SemWaitTimeout\fP\fR, \fI\fBSDL_SemPost\fP\fR, \fI\fBSDL_SemValue\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_SemWaitTimeout.3 b/docs/man3/SDL_SemWaitTimeout.3 new file mode 100644 index 0000000..8afd1cb --- /dev/null +++ b/docs/man3/SDL_SemWaitTimeout.3 @@ -0,0 +1,41 @@ +.TH "SDL_SemWaitTimeout" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_SemWaitTimeout \- Lock a semaphore, but only wait up to a specified maximum time\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +#include "SDL_thread\&.h" +.sp +\fBint \fBSDL_SemWaitTimeout\fP\fR(\fBSDL_sem *sem, Uint32 timeout\fR); +.SH "DESCRIPTION" +.PP +\fBSDL_SemWaitTimeout()\fP is a varient of \fISDL_SemWait\fR with a maximum timeout value\&. If the value of the semaphore pointed to by \fBsem\fR is positive (greater than zero) it will atomically decrement the semaphore value and return 0, otherwise it will wait up to \fBtimeout\fR milliseconds trying to lock the semaphore\&. This function is to be avoided if possible since on some platforms it is implemented by polling the semaphore every millisecond in a busy loop\&. +.PP +After \fBSDL_SemWaitTimeout()\fP is successful, the semaphore can be released and its count atomically incremented by a successful call to \fISDL_SemPost\fR\&. +.SH "RETURN VALUE" +.PP +Returns \fB0\fR if the semaphore was successfully locked or either \fBSDL_MUTEX_TIMEOUT\fR or \fB-1\fR if the timeout period was exceeded or there was an error, respectivly\&. +.PP +If the semaphore was not successfully locked, the semaphore will be unchanged\&. +.SH "EXAMPLES" +.PP +.PP +.nf +\f(CWres = SDL_SemWaitTimeout(my_sem, WAIT_TIMEOUT_MILLISEC); + +if (res == SDL_MUTEX_TIMEOUT) { + return TRY_AGAIN; +} +if (res == -1) { + return WAIT_ERROR; +} + +\&.\&.\&. + +SDL_SemPost(my_sem);\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_CreateSemaphore\fP\fR, \fI\fBSDL_DestroySemaphore\fP\fR, \fI\fBSDL_SemWait\fP\fR, \fI\fBSDL_SemTryWait\fP\fR, \fI\fBSDL_SemPost\fP\fR, \fI\fBSDL_SemValue\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_SetAlpha.3 b/docs/man3/SDL_SetAlpha.3 new file mode 100644 index 0000000..282ecde --- /dev/null +++ b/docs/man3/SDL_SetAlpha.3 @@ -0,0 +1,66 @@ +.TH "SDL_SetAlpha" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_SetAlpha \- Adjust the alpha properties of a surface +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_SetAlpha\fP\fR(\fBSDL_Surface *surface, Uint32 flag, Uint8 alpha\fR); +.SH "DESCRIPTION" +.PP +.RS +\fBNote: +.PP +This function and the semantics of SDL alpha blending have changed since version 1\&.1\&.4\&. Up until version 1\&.1\&.5, an alpha value of 0 was considered opaque and a value of 255 was considered transparent\&. This has now been inverted: 0 (\fBSDL_ALPHA_TRANSPARENT\fP) is now considered transparent and 255 (\fBSDL_ALPHA_OPAQUE\fP) is now considered opaque\&. +.RE +.PP +\fBSDL_SetAlpha\fP is used for setting the per-surface alpha value and/or enabling and disabling alpha blending\&. +.PP +The\fBsurface\fR parameter specifies which surface whose alpha attributes you wish to adjust\&. \fBflags\fR is used to specify whether alpha blending should be used (\fBSDL_SRCALPHA\fP) and whether the surface should use RLE acceleration for blitting (\fBSDL_RLEACCEL\fP)\&. \fBflags\fR can be an OR\&'d combination of these two options, one of these options or 0\&. If \fBSDL_SRCALPHA\fP is not passed as a flag then all alpha information is ignored when blitting the surface\&. The \fBalpha\fR parameter is the per-surface alpha value; a surface need not have an alpha channel to use per-surface alpha and blitting can still be accelerated with \fBSDL_RLEACCEL\fP\&. +.PP +.RS +\fBNote: +.PP +The per-surface alpha value of 128 is considered a special case and is optimised, so it\&'s much faster than other per-surface values\&. +.RE +.PP +Alpha effects surface blitting in the following ways: +.TP 20 +RGBA->RGB with \fBSDL_SRCALPHA\fP +The source is alpha-blended with the destination, using the alpha channel\&. \fBSDL_SRCCOLORKEY\fP and the per-surface alpha are ignored\&. +.TP 20 +RGBA->RGB without \fBSDL_SRCALPHA\fP +The RGB data is copied from the source\&. The source alpha channel and the per-surface alpha value are ignored\&. +.TP 20 +RGB->RGBA with \fBSDL_SRCALPHA\fP +The source is alpha-blended with the destination using the per-surface alpha value\&. If \fBSDL_SRCCOLORKEY\fP is set, only the pixels not matching the colorkey value are copied\&. The alpha channel of the copied pixels is set to opaque\&. +.TP 20 +RGB->RGBA without \fBSDL_SRCALPHA\fP +The RGB data is copied from the source and the alpha value of the copied pixels is set to opaque\&. If \fBSDL_SRCCOLORKEY\fP is set, only the pixels not matching the colorkey value are copied\&. +.TP 20 +RGBA->RGBA with \fBSDL_SRCALPHA\fP +The source is alpha-blended with the destination using the source alpha channel\&. The alpha channel in the destination surface is left untouched\&. \fBSDL_SRCCOLORKEY\fP is ignored\&. +.TP 20 +RGBA->RGBA without \fBSDL_SRCALPHA\fP +The RGBA data is copied to the destination surface\&. If \fBSDL_SRCCOLORKEY\fP is set, only the pixels not matching the colorkey value are copied\&. +.TP 20 +RGB->RGB with \fBSDL_SRCALPHA\fP +The source is alpha-blended with the destination using the per-surface alpha value\&. If \fBSDL_SRCCOLORKEY\fP is set, only the pixels not matching the colorkey value are copied\&. +.TP 20 +RGB->RGB without \fBSDL_SRCALPHA\fP +The RGB data is copied from the source\&. If \fBSDL_SRCCOLORKEY\fP is set, only the pixels not matching the colorkey value are copied\&. +.PP +.RS +\fBNote: +.PP + Note that RGBA->RGBA blits (with SDL_SRCALPHA set) keep the alpha of the destination surface\&. This means that you cannot compose two arbitrary RGBA surfaces this way and get the result you would expect from "overlaying" them; the destination alpha will work as a mask\&. +.PP +Also note that per-pixel and per-surface alpha cannot be combined; the per-pixel alpha is always used if available +.RE +.SH "RETURN VALUE" +.PP +This function returns \fB0\fR, or \fB-1\fR if there was an error\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_MapRGBA\fP\fR, \fI\fBSDL_GetRGBA\fP\fR, \fI\fBSDL_DisplayFormatAlpha\fP\fR, \fI\fBSDL_BlitSurface\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_SetClipRect.3 b/docs/man3/SDL_SetClipRect.3 new file mode 100644 index 0000000..a1bde08 --- /dev/null +++ b/docs/man3/SDL_SetClipRect.3 @@ -0,0 +1,19 @@ +.TH "SDL_SetClipRect" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_SetClipRect \- Sets the clipping rectangle for a surface\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_SetClipRect\fP\fR(\fBSDL_Surface *surface, SDL_Rect *rect\fR); +.SH "DESCRIPTION" +.PP +Sets the clipping rectangle for a surface\&. When this surface is the destination of a blit, only the area within the clip rectangle will be drawn into\&. +.PP +The rectangle pointed to by \fBrect\fR will be clipped to the edges of the surface so that the clip rectangle for a surface can never fall outside the edges of the surface\&. +.PP +If \fBrect\fR is \fBNULL\fP the clipping rectangle will be set to the full size of the surface\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_GetClipRect\fP\fR, \fI\fBSDL_BlitSurface\fP\fR, \fI\fBSDL_Surface\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_SetColorKey.3 b/docs/man3/SDL_SetColorKey.3 new file mode 100644 index 0000000..36f8893 --- /dev/null +++ b/docs/man3/SDL_SetColorKey.3 @@ -0,0 +1,26 @@ +.TH "SDL_SetColorKey" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_SetColorKey \- Sets the color key (transparent pixel) in a blittable surface and RLE acceleration\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_SetColorKey\fP\fR(\fBSDL_Surface *surface, Uint32 flag, Uint32 key\fR); +.SH "DESCRIPTION" +.PP + Sets the color key (transparent pixel) in a blittable surface and enables or disables RLE blit acceleration\&. +.PP +RLE acceleration can substantially speed up blitting of images with large horizontal runs of transparent pixels (i\&.e\&., pixels that match the \fBkey\fR value)\&. The \fBkey\fR must be of the same pixel format as the \fBsurface\fR, \fI\fBSDL_MapRGB\fP\fR is often useful for obtaining an acceptable value\&. +.PP +If \fBflag\fR is \fBSDL_SRCCOLORKEY\fP then \fBkey\fR is the transparent pixel value in the source image of a blit\&. +.PP +If \fBflag\fR is OR\&'d with \fBSDL_RLEACCEL\fP then the surface will be draw using RLE acceleration when drawn with \fISDL_BlitSurface\fR\&. The surface will actually be encoded for RLE acceleration the first time \fISDL_BlitSurface\fR or \fISDL_DisplayFormat\fR is called on the surface\&. +.PP +If \fBflag\fR is 0, this function clears any current color key\&. +.SH "RETURN VALUE" +.PP +This function returns \fB0\fR, or \fB-1\fR if there was an error\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_BlitSurface\fP\fR, \fI\fBSDL_DisplayFormat\fP\fR, \fI\fBSDL_MapRGB\fP\fR, \fI\fBSDL_SetAlpha\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_SetColors.3 b/docs/man3/SDL_SetColors.3 new file mode 100644 index 0000000..7137a6c --- /dev/null +++ b/docs/man3/SDL_SetColors.3 @@ -0,0 +1,57 @@ +.TH "SDL_SetColors" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_SetColors \- Sets a portion of the colormap for the given 8-bit surface\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_SetColors\fP\fR(\fBSDL_Surface *surface, SDL_Color *colors, int firstcolor, int ncolors\fR); +.SH "DESCRIPTION" +.PP +Sets a portion of the colormap for the given 8-bit surface\&. +.PP +When \fBsurface\fR is the surface associated with the current display, the display colormap will be updated with the requested colors\&. If \fBSDL_HWPALETTE\fP was set in \fISDL_SetVideoMode\fR flags, \fBSDL_SetColors\fP will always return \fB1\fR, and the palette is guaranteed to be set the way you desire, even if the window colormap has to be warped or run under emulation\&. +.PP +The color components of a \fI\fBSDL_Color\fR\fR structure are 8-bits in size, giving you a total of 256^3 =16777216 colors\&. +.PP +Palettized (8-bit) screen surfaces with the \fBSDL_HWPALETTE\fP flag have two palettes, a logical palette that is used for mapping blits to/from the surface and a physical palette (that determines how the hardware will map the colors to the display)\&. \fBSDL_SetColors\fP modifies both palettes (if present), and is equivalent to calling \fISDL_SetPalette\fR with the \fBflags\fR set to \fB(SDL_LOGPAL | SDL_PHYSPAL)\fP\&. +.SH "RETURN VALUE" +.PP +If \fBsurface\fR is not a palettized surface, this function does nothing, returning \fB0\fR\&. If all of the colors were set as passed to \fBSDL_SetColors\fP, it will return \fB1\fR\&. If not all the color entries were set exactly as given, it will return \fB0\fR, and you should look at the surface palette to determine the actual color palette\&. +.SH "EXAMPLE" +.PP +.nf +\f(CW/* Create a display surface with a grayscale palette */ +SDL_Surface *screen; +SDL_Color colors[256]; +int i; +\&. +\&. +\&. +/* Fill colors with color information */ +for(i=0;i<256;i++){ + colors[i]\&.r=i; + colors[i]\&.g=i; + colors[i]\&.b=i; +} + +/* Create display */ +screen=SDL_SetVideoMode(640, 480, 8, SDL_HWPALETTE); +if(!screen){ + printf("Couldn\&'t set video mode: %s +", SDL_GetError()); + exit(-1); +} + +/* Set palette */ +SDL_SetColors(screen, colors, 0, 256); +\&. +\&. +\&. +\&.\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_Color\fR\fR \fI\fBSDL_Surface\fR\fR, \fI\fBSDL_SetPalette\fP\fR, \fI\fBSDL_SetVideoMode\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_SetCursor.3 b/docs/man3/SDL_SetCursor.3 new file mode 100644 index 0000000..78c4cf9 --- /dev/null +++ b/docs/man3/SDL_SetCursor.3 @@ -0,0 +1,15 @@ +.TH "SDL_SetCursor" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_SetCursor \- Set the currently active mouse cursor\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_SetCursor\fP\fR(\fBSDL_Cursor *cursor\fR); +.SH "DESCRIPTION" +.PP +Sets the currently active cursor to the specified one\&. If the cursor is currently visible, the change will be immediately represented on the display\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_GetCursor\fP\fR, \fI\fBSDL_CreateCursor\fP\fR, \fI\fBSDL_ShowCursor\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_SetEventFilter.3 b/docs/man3/SDL_SetEventFilter.3 new file mode 100644 index 0000000..8d3ed03 --- /dev/null +++ b/docs/man3/SDL_SetEventFilter.3 @@ -0,0 +1,35 @@ +.TH "SDL_SetEventFilter" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" +.SH "NAME" +SDL_SetEventFilter \- Sets up a filter to process all events before they are posted to the event queue\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_SetEventFilter\fP\fR(\fBSDL_EventFilter filter\fR); +.SH "DESCRIPTION" +.PP +This function sets up a filter to process all events before they are posted to the event queue\&. This is a very powerful and flexible feature\&. The filter is prototyped as: +.PP +.nf +\f(CWtypedef int (*SDL_EventFilter)(const SDL_Event *event);\fR +.fi +.PP + If the filter returns \fB1\fR, then the event will be added to the internal queue\&. If it returns \fB0\fR, then the event will be dropped from the queue\&. This allows selective filtering of dynamically\&. +.PP +There is one caveat when dealing with the \fBSDL_QUITEVENT\fP event type\&. The event filter is only called when the window manager desires to close the application window\&. If the event filter returns 1, then the window will be closed, otherwise the window will remain open if possible\&. If the quit event is generated by an interrupt signal, it will bypass the internal queue and be delivered to the application at the next event poll\&. +.PP +.RS +\fBNote: +.PP +Events pushed onto the queue with \fI\fBSDL_PushEvent\fP\fR or \fI\fBSDL_PeepEvents\fP\fR do not get passed through the event filter\&. +.RE +.PP +.RS +\fBNote: +.PP +\fIBe Careful!\fP The event filter function may run in a different thread so be careful what you do within it\&. +.RE +.SH "SEE ALSO" +.PP +\fI\fBSDL_Event\fR\fR, \fI\fBSDL_GetEventFilter\fP\fR, \fI\fBSDL_PushEvent\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_SetGamma.3 b/docs/man3/SDL_SetGamma.3 new file mode 100644 index 0000000..4897272 --- /dev/null +++ b/docs/man3/SDL_SetGamma.3 @@ -0,0 +1,22 @@ +.TH "SDL_SetGamma" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_SetGamma \- Sets the color gamma function for the display +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_SetGamma\fP\fR(\fBfloat redgamma, float greengamma, float bluegamma\fR); +.SH "DESCRIPTION" +.PP +Sets the "gamma function" for the display of each color component\&. Gamma controls the brightness/contrast of colors displayed on the screen\&. A gamma value of 1\&.0 is identity (i\&.e\&., no adjustment is made)\&. +.PP +This function adjusts the gamma based on the "gamma function" parameter, you can directly specify lookup tables for gamma adjustment with \fISDL_SetGammaRamp\fR\&. +.PP +Not all display hardware is able to change gamma\&. +.SH "RETURN VALUE" +.PP +Returns -1 on error (or if gamma adjustment is not supported)\&. +.SH "SEE ALSO" +.PP +\fISDL_GetGammaRamp\fR \fISDL_SetGammaRamp\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_SetGammaRamp.3 b/docs/man3/SDL_SetGammaRamp.3 new file mode 100644 index 0000000..52bf9f5 --- /dev/null +++ b/docs/man3/SDL_SetGammaRamp.3 @@ -0,0 +1,22 @@ +.TH "SDL_SetGammaRamp" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_SetGammaRamp \- Sets the color gamma lookup tables for the display +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_SetGammaRamp\fP\fR(\fBUint16 *redtable, Uint16 *greentable, Uint16 *bluetable\fR); +.SH "DESCRIPTION" +.PP +Sets the gamma lookup tables for the display for each color component\&. Each table is an array of 256 Uint16 values, representing a mapping between the input and output for that channel\&. The input is the index into the array, and the output is the 16-bit gamma value at that index, scaled to the output color precision\&. You may pass NULL to any of the channels to leave them unchanged\&. +.PP +This function adjusts the gamma based on lookup tables, you can also have the gamma calculated based on a "gamma function" parameter with \fISDL_SetGamma\fR\&. +.PP +Not all display hardware is able to change gamma\&. +.SH "RETURN VALUE" +.PP +Returns -1 on error (or if gamma adjustment is not supported)\&. +.SH "SEE ALSO" +.PP +\fISDL_SetGamma\fR \fISDL_GetGammaRamp\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_SetModState.3 b/docs/man3/SDL_SetModState.3 new file mode 100644 index 0000000..f356ca1 --- /dev/null +++ b/docs/man3/SDL_SetModState.3 @@ -0,0 +1,35 @@ +.TH "SDL_SetModState" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_SetModState \- Set the current key modifier state +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_SetModState\fP\fR(\fBSDLMod modstate\fR); +.SH "DESCRIPTION" +.PP +The inverse of \fI\fBSDL_GetModState\fP\fR, \fBSDL_SetModState\fP allows you to impose modifier key states on your application\&. +.PP +Simply pass your desired modifier states into \fBmodstate\fR\&. This value my be a logical OR\&'d combination of the following: +.PP +.nf +\f(CWtypedef enum { + KMOD_NONE = 0x0000, + KMOD_LSHIFT= 0x0001, + KMOD_RSHIFT= 0x0002, + KMOD_LCTRL = 0x0040, + KMOD_RCTRL = 0x0080, + KMOD_LALT = 0x0100, + KMOD_RALT = 0x0200, + KMOD_LMETA = 0x0400, + KMOD_RMETA = 0x0800, + KMOD_NUM = 0x1000, + KMOD_CAPS = 0x2000, + KMOD_MODE = 0x4000, +} SDLMod;\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_GetModState\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_SetPalette.3 b/docs/man3/SDL_SetPalette.3 new file mode 100644 index 0000000..a2ca3f6 --- /dev/null +++ b/docs/man3/SDL_SetPalette.3 @@ -0,0 +1,59 @@ +.TH "SDL_SetPalette" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_SetPalette \- Sets the colors in the palette of an 8-bit surface\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_SetPalette\fP\fR(\fBSDL_Surface *surface, int flags, SDL_Color *colors, int firstcolor, int ncolors\fR); +.SH "DESCRIPTION" +.PP +Sets a portion of the palette for the given 8-bit surface\&. +.PP +Palettized (8-bit) screen surfaces with the \fBSDL_HWPALETTE\fP flag have two palettes, a logical palette that is used for mapping blits to/from the surface and a physical palette (that determines how the hardware will map the colors to the display)\&. \fISDL_BlitSurface\fR always uses the logical palette when blitting surfaces (if it has to convert between surface pixel formats)\&. Because of this, it is often useful to modify only one or the other palette to achieve various special color effects (e\&.g\&., screen fading, color flashes, screen dimming)\&. +.PP +This function can modify either the logical or physical palette by specifing \fBSDL_LOGPAL\fP or \fBSDL_PHYSPAL\fPthe in the \fBflags\fR parameter\&. +.PP +When \fBsurface\fR is the surface associated with the current display, the display colormap will be updated with the requested colors\&. If \fBSDL_HWPALETTE\fP was set in \fISDL_SetVideoMode\fR flags, \fBSDL_SetPalette\fP will always return \fB1\fR, and the palette is guaranteed to be set the way you desire, even if the window colormap has to be warped or run under emulation\&. +.PP +The color components of a \fI\fBSDL_Color\fR\fR structure are 8-bits in size, giving you a total of 256^3=16777216 colors\&. +.SH "RETURN VALUE" +.PP +If \fBsurface\fR is not a palettized surface, this function does nothing, returning \fB0\fR\&. If all of the colors were set as passed to \fBSDL_SetPalette\fP, it will return \fB1\fR\&. If not all the color entries were set exactly as given, it will return \fB0\fR, and you should look at the surface palette to determine the actual color palette\&. +.SH "EXAMPLE" +.PP +.nf +\f(CW /* Create a display surface with a grayscale palette */ + SDL_Surface *screen; + SDL_Color colors[256]; + int i; + \&. + \&. + \&. + /* Fill colors with color information */ + for(i=0;i<256;i++){ + colors[i]\&.r=i; + colors[i]\&.g=i; + colors[i]\&.b=i; + } + + /* Create display */ + screen=SDL_SetVideoMode(640, 480, 8, SDL_HWPALETTE); + if(!screen){ + printf("Couldn\&'t set video mode: %s +", SDL_GetError()); + exit(-1); + } + + /* Set palette */ + SDL_SetPalette(screen, SDL_LOGPAL|SDL_PHYSPAL, colors, 0, 256); + \&. + \&. + \&. + \&.\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fISDL_SetColors\fR, \fISDL_SetVideoMode\fR, \fISDL_Surface\fR, \fISDL_Color\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_SetTimer.3 b/docs/man3/SDL_SetTimer.3 new file mode 100644 index 0000000..418ac86 --- /dev/null +++ b/docs/man3/SDL_SetTimer.3 @@ -0,0 +1,39 @@ +.TH "SDL_SetTimer" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_SetTimer \- Set a callback to run after the specified number of milliseconds has elapsed\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_SetTimer\fP\fR(\fBUint32 interval, SDL_TimerCallback callback\fR); +.SH "CALLBACK" +.PP +/* Function prototype for the timer callback function */ typedef Uint32 (*SDL_TimerCallback)(Uint32 interval); +.SH "DESCRIPTION" +.PP +Set a callback to run after the specified number of milliseconds has elapsed\&. The callback function is passed the current timer interval and returns the next timer interval\&. If the returned value is the same as the one passed in, the periodic alarm continues, otherwise a new alarm is scheduled\&. +.PP +To cancel a currently running timer, call \fBSDL_SetTimer(0, NULL);\fP +.PP +The timer callback function may run in a different thread than your main constant, and so shouldn\&'t call any functions from within itself\&. +.PP +The maximum resolution of this timer is 10 ms, which means that if you request a 16 ms timer, your callback will run approximately 20 ms later on an unloaded system\&. If you wanted to set a flag signaling a frame update at 30 frames per second (every 33 ms), you might set a timer for 30 ms (see example below)\&. +.PP +If you use this function, you need to pass \fBSDL_INIT_TIMER\fP to \fBSDL_Init()\fP\&. +.PP +.RS +\fBNote: +.PP +This function is kept for compatibility but has been superseded by the new timer functions \fISDL_AddTimer\fR and \fISDL_RemoveTimer\fR which support multiple timers\&. +.RE +.SH "EXAMPLES" +.PP +.PP +.nf +\f(CWSDL_SetTimer((33/10)*10, my_callback);\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_AddTimer\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_SetVideoMode.3 b/docs/man3/SDL_SetVideoMode.3 new file mode 100644 index 0000000..95defb1 --- /dev/null +++ b/docs/man3/SDL_SetVideoMode.3 @@ -0,0 +1,67 @@ +.TH "SDL_SetVideoMode" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_SetVideoMode \- Set up a video mode with the specified width, height and bits-per-pixel\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBSDL_Surface *\fBSDL_SetVideoMode\fP\fR(\fBint width, int height, int bpp, Uint32 flags\fR); +.SH "DESCRIPTION" +.PP +Set up a video mode with the specified width, height and bits-per-pixel\&. +.PP +If \fBbpp\fR is 0, it is treated as the current display bits per pixel\&. +.PP +The \fBflags\fR parameter is the same as the \fBflags\fR field of the \fI\fBSDL_Surface\fR\fR structure\&. OR\&'d combinations of the following values are valid\&. +.TP 20 +\fBSDL_SWSURFACE\fP +Create the video surface in system memory +.TP 20 +\fBSDL_HWSURFACE\fP +Create the video surface in video memory +.TP 20 +\fBSDL_ASYNCBLIT\fP +Enables the use of asynchronous updates of the display surface\&. This will usually slow down blitting on single CPU machines, but may provide a speed increase on SMP systems\&. +.TP 20 +\fBSDL_ANYFORMAT\fP +Normally, if a video surface of the requested bits-per-pixel (\fBbpp\fR) is not available, SDL will emulate one with a shadow surface\&. Passing \fBSDL_ANYFORMAT\fP prevents this and causes SDL to use the video surface, regardless of its pixel depth\&. +.TP 20 +\fBSDL_HWPALETTE\fP +Give SDL exclusive palette access\&. Without this flag you may not always get the the colors you request with \fI\fBSDL_SetColors\fP\fR or \fI\fBSDL_SetPalette\fP\fR\&. +.TP 20 +\fBSDL_DOUBLEBUF\fP +Enable hardware double buffering; only valid with SDL_HWSURFACE\&. Calling \fI\fBSDL_Flip\fP\fR will flip the buffers and update the screen\&. All drawing will take place on the surface that is not displayed at the moment\&. If double buffering could not be enabled then \fBSDL_Flip\fP will just perform a \fI\fBSDL_UpdateRect\fP\fR on the entire screen\&. +.TP 20 +\fBSDL_FULLSCREEN\fP +SDL will attempt to use a fullscreen mode\&. If a hardware resolution change is not possible (for whatever reason), the next higher resolution will be used and the display window centered on a black background\&. +.TP 20 +\fBSDL_OPENGL\fP +Create an OpenGL rendering context\&. You should have previously set OpenGL video attributes with \fI\fBSDL_GL_SetAttribute\fP\fR\&. +.TP 20 +\fBSDL_OPENGLBLIT\fP +Create an OpenGL rendering context, like above, but allow normal blitting operations\&. The screen (2D) surface may have an alpha channel, and \fI\fBSDL_UpdateRects\fP\fR must be used for updating changes to the screen surface\&. +.TP 20 +\fBSDL_RESIZABLE\fP +Create a resizable window\&. When the window is resized by the user a \fI\fBSDL_VIDEORESIZE\fP\fR event is generated and \fBSDL_SetVideoMode\fP can be called again with the new size\&. +.TP 20 +\fBSDL_NOFRAME\fP +If possible, \fBSDL_NOFRAME\fP causes SDL to create a window with no title bar or frame decoration\&. Fullscreen modes automatically have this flag set\&. +.PP +.RS +\fBNote: +.PP +Whatever \fBflags\fR \fBSDL_SetVideoMode\fP could satisfy are set in the \fBflags\fR member of the returned surface\&. +.RE +.PP +.RS +\fBNote: +.PP +The \fBbpp\fR parameter is the number of bits per pixel, so a \fBbpp\fR of 24 uses the packed representation of 3 bytes/pixel\&. For the more common 4 bytes/pixel mode, use a \fBbpp\fR of 32\&. Somewhat oddly, both 15 and 16 will request a 2 bytes/pixel mode, but different pixel formats\&. +.RE +.SH "RETURN VALUE" +.PP +The framebuffer surface, or \fBNULL\fR if it fails\&. The surface returned is freed by SDL_Quit() and should nt be freed by the caller\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_LockSurface\fP\fR, \fI\fBSDL_SetColors\fP\fR, \fI\fBSDL_Flip\fP\fR, \fI\fBSDL_Surface\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_ShowCursor.3 b/docs/man3/SDL_ShowCursor.3 new file mode 100644 index 0000000..0376415 --- /dev/null +++ b/docs/man3/SDL_ShowCursor.3 @@ -0,0 +1,20 @@ +.TH "SDL_ShowCursor" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_ShowCursor \- Toggle whether or not the cursor is shown on the screen\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_ShowCursor\fP\fR(\fBint toggle\fR); +.SH "DESCRIPTION" +.PP +Toggle whether or not the cursor is shown on the screen\&. Passing \fBSDL_ENABLE\fP displays the cursor and passing \fBSDL_DISABLE\fP hides it\&. The current state of the mouse cursor can be queried by passing \fBSDL_QUERY\fP, either \fBSDL_DISABLE\fP or \fBSDL_ENABLE\fP will be returned\&. +.PP +The cursor starts off displayed, but can be turned off\&. +.SH "RETURN VALUE" +.PP +Returns the current state of the cursor\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_CreateCursor\fP\fR, \fI\fBSDL_SetCursor\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_Surface.3 b/docs/man3/SDL_Surface.3 new file mode 100644 index 0000000..03d6ff9 --- /dev/null +++ b/docs/man3/SDL_Surface.3 @@ -0,0 +1,96 @@ +.TH "SDL_Surface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_Surface \- Graphical Surface Structure +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct SDL_Surface { + Uint32 flags; /* Read-only */ + SDL_PixelFormat *format; /* Read-only */ + int w, h; /* Read-only */ + Uint16 pitch; /* Read-only */ + void *pixels; /* Read-write */ + + /* clipping information */ + SDL_Rect clip_rect; /* Read-only */ + + /* Reference count -- used when freeing surface */ + int refcount; /* Read-mostly */ + + /* This structure also contains private fields not shown here */ +} SDL_Surface;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBflags\fR +Surface flags +.TP 20 +\fBformat\fR +Pixel \fIformat\fR +.TP 20 +\fBw, h\fR +Width and height of the surface +.TP 20 +\fBpitch\fR +Length of a surface scanline in bytes +.TP 20 +\fBpixels\fR +Pointer to the actual pixel data +.TP 20 +\fBclip_rect\fR +surface clip \fIrectangle\fR +.SH "DESCRIPTION" +.PP +\fBSDL_Surface\fR\&'s represent areas of "graphical" memory, memory that can be drawn to\&. The video framebuffer is returned as a \fBSDL_Surface\fR by \fI\fBSDL_SetVideoMode\fP\fR and \fI\fBSDL_GetVideoSurface\fP\fR\&. Most of the fields should be pretty obvious\&. \fBw\fR and \fBh\fR are the width and height of the surface in pixels\&. \fBpixels\fR is a pointer to the actual pixel data, the surface should be \fIlocked\fR before accessing this field\&. The \fBclip_rect\fR field is the clipping rectangle as set by \fI\fBSDL_SetClipRect\fP\fR\&. +.PP +The following are supported in the \fBflags\fR field\&. +.TP 20 +\fBSDL_SWSURFACE\fP +Surface is stored in system memory +.TP 20 +\fBSDL_HWSURFACE\fP +Surface is stored in video memory +.TP 20 +\fBSDL_ASYNCBLIT\fP +Surface uses asynchronous blits if possible +.TP 20 +\fBSDL_ANYFORMAT\fP +Allows any pixel-format (Display surface) +.TP 20 +\fBSDL_HWPALETTE\fP +Surface has exclusive palette +.TP 20 +\fBSDL_DOUBLEBUF\fP +Surface is double buffered (Display surface) +.TP 20 +\fBSDL_FULLSCREEN\fP +Surface is full screen (Display Surface) +.TP 20 +\fBSDL_OPENGL\fP +Surface has an OpenGL context (Display Surface) +.TP 20 +\fBSDL_OPENGLBLIT\fP +Surface supports OpenGL blitting (Display Surface) +.TP 20 +\fBSDL_RESIZABLE\fP +Surface is resizable (Display Surface) +.TP 20 +\fBSDL_HWACCEL\fP +Surface blit uses hardware acceleration +.TP 20 +\fBSDL_SRCCOLORKEY\fP +Surface use colorkey blitting +.TP 20 +\fBSDL_RLEACCEL\fP +Colorkey blitting is accelerated with RLE +.TP 20 +\fBSDL_SRCALPHA\fP +Surface blit uses alpha blending +.TP 20 +\fBSDL_PREALLOC\fP +Surface uses preallocated memory +.SH "SEE ALSO" +.PP +\fI\fBSDL_PixelFormat\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_SysWMEvent.3 b/docs/man3/SDL_SysWMEvent.3 new file mode 100644 index 0000000..ca1b7ab --- /dev/null +++ b/docs/man3/SDL_SysWMEvent.3 @@ -0,0 +1,21 @@ +.TH "SDL_SysWMEvent" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_SysWMEvent \- Platform-dependent window manager event\&. +.SH "DESCRIPTION" +.PP +The system window manager event contains a pointer to system-specific information about unknown window manager events\&. If you enable this event using \fI\fBSDL_EventState()\fP\fR, it will be generated whenever unhandled events are received from the window manager\&. This can be used, for example, to implement cut-and-paste in your application\&. +.PP +.nf +\f(CWtypedef struct { + Uint8 type; /* Always SDL_SysWM */ + } SDL_SysWMEvent;\fR +.fi +.PP + If you want to obtain system-specific information about the window manager, you can fill the version member of a \fBSDL_SysWMinfo\fR structure (details can be found in \fBSDL_syswm\&.h\fP, which must be included) using the \fBSDL_VERSION()\fP macro found in \fBSDL_version\&.h\fP, and pass it to the function: +.PP +.sp +\fBint \fBSDL_GetWMInfo\fP\fR(\fBSDL_SysWMinfo *info\fR); +.SH "SEE ALSO" +.PP +\fI\fBSDL_EventState\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_ThreadID.3 b/docs/man3/SDL_ThreadID.3 new file mode 100644 index 0000000..10e2cf8 --- /dev/null +++ b/docs/man3/SDL_ThreadID.3 @@ -0,0 +1,13 @@ +.TH "SDL_ThreadID" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_ThreadID \- Get the 32-bit thread identifier for the current thread\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +#include "SDL_thread\&.h" +.sp +\fBUint32 \fBSDL_ThreadID\fP\fR(\fBvoid\fR) +.SH "DESCRIPTION" +.PP +Get the 32-bit thread identifier for the current thread\&. +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_UnlockAudio.3 b/docs/man3/SDL_UnlockAudio.3 new file mode 100644 index 0000000..8506319 --- /dev/null +++ b/docs/man3/SDL_UnlockAudio.3 @@ -0,0 +1,15 @@ +.TH "SDL_UnlockAudio" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" +.SH "NAME" +SDL_UnlockAudio \- Unlock the callback function +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_UnlockAudio\fP\fR(\fBvoid\fR) +.SH "DESCRIPTION" +.PP +Unlocks a previous \fI\fBSDL_LockAudio\fP\fR call\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_OpenAudio\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_UnlockSurface.3 b/docs/man3/SDL_UnlockSurface.3 new file mode 100644 index 0000000..a3fe5c9 --- /dev/null +++ b/docs/man3/SDL_UnlockSurface.3 @@ -0,0 +1,17 @@ +.TH "SDL_UnlockSurface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_UnlockSurface \- Unlocks a previously locked surface\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_UnlockSurface\fP\fR(\fBSDL_Surface *surface\fR); +.SH "DESCRIPTION" +.PP +Surfaces that were previously locked using \fBSDL_LockSurface\fP must be unlocked with \fBSDL_UnlockSurface\fP\&. Surfaces should be unlocked as soon as possible\&. +.PP +It should be noted that since 1\&.1\&.8, surface locks are recursive\&. See \fI\fBSDL_LockSurface\fP\fR\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_LockSurface\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_UnlockYUVOverlay.3 b/docs/man3/SDL_UnlockYUVOverlay.3 new file mode 100644 index 0000000..1e6b721 --- /dev/null +++ b/docs/man3/SDL_UnlockYUVOverlay.3 @@ -0,0 +1,15 @@ +.TH "SDL_UnlockYUVOverlay" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_UnlockYUVOverlay \- Unlock an overlay +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_UnlockYUVOverlay\fP\fR(\fBSDL_Overlay *overlay\fR); +.SH "DESCRIPTION" +.PP +The opposite to \fI\fBSDL_LockYUVOverlay\fP\fR\&. Unlocks a previously locked overlay\&. An overlay must be unlocked before it can be displayed\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_UnlockYUVOverlay\fP\fR, \fI\fBSDL_CreateYUVOverlay\fP\fR, \fI\fBSDL_Overlay\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_UpdateRect.3 b/docs/man3/SDL_UpdateRect.3 new file mode 100644 index 0000000..a101a83 --- /dev/null +++ b/docs/man3/SDL_UpdateRect.3 @@ -0,0 +1,19 @@ +.TH "SDL_UpdateRect" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_UpdateRect \- Makes sure the given area is updated on the given screen\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_UpdateRect\fP\fR(\fBSDL_Surface *screen, Sint32 x, Sint32 y, Sint32 w, Sint32 h\fR); +.SH "DESCRIPTION" +.PP +Makes sure the given area is updated on the given screen\&. The rectangle must be confined within the screen boundaries (no clipping is done)\&. +.PP +If \&'\fBx\fR\&', \&'\fBy\fR\&', \&'\fBw\fR\&' and \&'\fBh\fR\&' are all 0, \fBSDL_UpdateRect\fP will update the entire screen\&. +.PP +This function should not be called while \&'\fBscreen\fR\&' is \fIlocked\fR\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_UpdateRects\fP\fR, \fI\fBSDL_Rect\fR\fR, \fI\fBSDL_Surface\fR\fR, \fI\fBSDL_LockSurface\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_UpdateRects.3 b/docs/man3/SDL_UpdateRects.3 new file mode 100644 index 0000000..9ffdb08 --- /dev/null +++ b/docs/man3/SDL_UpdateRects.3 @@ -0,0 +1,25 @@ +.TH "SDL_UpdateRects" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_UpdateRects \- Makes sure the given list of rectangles is updated on the given screen\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_UpdateRects\fP\fR(\fBSDL_Surface *screen, int numrects, SDL_Rect *rects\fR); +.SH "DESCRIPTION" +.PP +Makes sure the given list of rectangles is updated on the given screen\&. The rectangles must all be confined within the screen boundaries (no clipping is done)\&. +.PP +This function should not be called while \fBscreen\fR is \fIlocked\fR\&. +.PP +.RS +\fBNote: +.PP +It is adviced to call this function only once per frame, since each call has some processing overhead\&. This is no restriction since you can pass any number of rectangles each time\&. +.PP +The rectangles are not automatically merged or checked for overlap\&. In general, the programmer can use his knowledge about his particular rectangles to merge them in an efficient way, to avoid overdraw\&. +.RE +.SH "SEE ALSO" +.PP +\fI\fBSDL_UpdateRect\fP\fR, \fI\fBSDL_Rect\fR\fR, \fI\fBSDL_Surface\fR\fR, \fI\fBSDL_LockSurface\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_UserEvent.3 b/docs/man3/SDL_UserEvent.3 new file mode 100644 index 0000000..d92ec53 --- /dev/null +++ b/docs/man3/SDL_UserEvent.3 @@ -0,0 +1,47 @@ +.TH "SDL_UserEvent" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_UserEvent \- A user-defined event type +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct{ + Uint8 type; + int code; + void *data1; + void *data2; +} SDL_UserEvent;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBtype\fR +\fBSDL_USEREVENT\fP through to \fBSDL_NUMEVENTS-1\fP +.TP 20 +\fBcode\fR +User defined event code +.TP 20 +\fBdata1\fR +User defined data pointer +.TP 20 +\fBdata2\fR +User defined data pointer +.SH "DESCRIPTION" +.PP +\fBSDL_UserEvent\fR is in the \fBuser\fR member of the structure \fI\fBSDL_Event\fR\fR\&. This event is unique, it is never created by SDL but only by the user\&. The event can be pushed onto the event queue using \fI\fBSDL_PushEvent\fP\fR\&. The contents of the structure members or completely up to the programmer, the only requirement is that \fBtype\fR is a value from \fBSDL_USEREVENT\fP to \fBSDL_NUMEVENTS-1\fP (inclusive)\&. +.SH "EXAMPLES" +.PP +.PP +.nf +\f(CWSDL_Event event; + +event\&.type = SDL_USEREVENT; +event\&.user\&.code = my_event_code; +event\&.user\&.data1 = significant_data; +event\&.user\&.data2 = 0; +SDL_PushEvent(&event);\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_Event\fR\fR, \fI\fBSDL_PushEvent\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_VideoDriverName.3 b/docs/man3/SDL_VideoDriverName.3 new file mode 100644 index 0000000..e8563b6 --- /dev/null +++ b/docs/man3/SDL_VideoDriverName.3 @@ -0,0 +1,18 @@ +.TH "SDL_VideoDriverName" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_VideoDriverName \- Obtain the name of the video driver +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBchar *\fBSDL_VideoDriverName\fP\fR(\fBchar *namebuf, int maxlen\fR); +.SH "DESCRIPTION" +.PP +The buffer pointed to by \fBnamebuf\fR is filled up to a maximum of \fBmaxlen\fR characters (include the NULL terminator) with the name of the initialised video driver\&. The driver name is a simple one word identifier like "x11" or "windib"\&. +.SH "RETURN VALUE" +.PP +Returns \fBNULL\fP if video has not been initialised with \fBSDL_Init\fP or a pointer to \fBnamebuf\fR otherwise\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_Init\fP\fR \fI\fBSDL_InitSubSystem\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_VideoInfo.3 b/docs/man3/SDL_VideoInfo.3 new file mode 100644 index 0000000..c62e1ff --- /dev/null +++ b/docs/man3/SDL_VideoInfo.3 @@ -0,0 +1,62 @@ +.TH "SDL_VideoInfo" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_VideoInfo \- Video Target information +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct{ + Uint32 hw_available:1; + Uint32 wm_available:1; + Uint32 blit_hw:1; + Uint32 blit_hw_CC:1; + Uint32 blit_hw_A:1; + Uint32 blit_sw:1; + Uint32 blit_sw_CC:1; + Uint32 blit_sw_A:1; + Uint32 blit_fill; + Uint32 video_mem; + SDL_PixelFormat *vfmt; +} SDL_VideoInfo;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBhw_available\fR +Is it possible to create hardware surfaces? +.TP 20 +\fBwm_available\fR +Is there a window manager available +.TP 20 +\fBblit_hw\fR +Are hardware to hardware blits accelerated? +.TP 20 +\fBblit_hw_CC\fR +Are hardware to hardware colorkey blits accelerated? +.TP 20 +\fBblit_hw_A\fR +Are hardware to hardware alpha blits accelerated? +.TP 20 +\fBblit_sw\fR +Are software to hardware blits accelerated? +.TP 20 +\fBblit_sw_CC\fR +Are software to hardware colorkey blits accelerated? +.TP 20 +\fBblit_sw_A\fR +Are software to hardware alpha blits accelerated? +.TP 20 +\fBblit_fill\fR +Are color fills accelerated? +.TP 20 +\fBvideo_mem\fR +Total amount of video memory in Kilobytes +.TP 20 +\fBvfmt\fR +\fIPixel format\fR of the video device +.SH "DESCRIPTION" +.PP +This (read-only) structure is returned by \fI\fBSDL_GetVideoInfo\fP\fR\&. It contains information on either the \&'best\&' available mode (if called before \fI\fBSDL_SetVideoMode\fP\fR) or the current video mode\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_PixelFormat\fR\fR, \fI\fBSDL_GetVideoInfo\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_VideoModeOK.3 b/docs/man3/SDL_VideoModeOK.3 new file mode 100644 index 0000000..72c9a90 --- /dev/null +++ b/docs/man3/SDL_VideoModeOK.3 @@ -0,0 +1,44 @@ +.TH "SDL_VideoModeOK" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_VideoModeOK \- Check to see if a particular video mode is supported\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_VideoModeOK\fP\fR(\fBint width, int height, int bpp, Uint32 flags\fR); +.SH "DESCRIPTION" +.PP +\fBSDL_VideoModeOK\fP returns \fB0\fR if the requested mode is not supported under any bit depth, or returns the bits-per-pixel of the closest available mode with the given width, height and requested \fIsurface\fR flags (see \fI\fBSDL_SetVideoMode\fP\fR)\&. +.PP +The bits-per-pixel value returned is only a suggested mode\&. You can usually request and bpp you want when \fIsetting\fR the video mode and SDL will emulate that color depth with a shadow video surface\&. +.PP +The arguments to \fBSDL_VideoModeOK\fP are the same ones you would pass to \fISDL_SetVideoMode\fR +.SH "EXAMPLE" +.PP +.nf +\f(CWSDL_Surface *screen; +Uint32 bpp; +\&. +\&. +\&. +printf("Checking mode 640x480@16bpp\&. +"); +bpp=SDL_VideoModeOK(640, 480, 16, SDL_HWSURFACE); + +if(!bpp){ + printf("Mode not available\&. +"); + exit(-1); +} + +printf("SDL Recommends 640x480@%dbpp\&. +", bpp); +screen=SDL_SetVideoMode(640, 480, bpp, SDL_HWSURFACE); +\&. +\&.\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_GetVideoInfo\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_WM_GetCaption.3 b/docs/man3/SDL_WM_GetCaption.3 new file mode 100644 index 0000000..68ed8b2 --- /dev/null +++ b/docs/man3/SDL_WM_GetCaption.3 @@ -0,0 +1,15 @@ +.TH "SDL_WM_GetCaption" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_WM_GetCaption \- Gets the window title and icon name\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_WM_GetCaption\fP\fR(\fBchar **title, char **icon\fR); +.SH "DESCRIPTION" +.PP +Set pointers to the window \fBtitle\fR and \fBicon\fR name\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_WM_SetCaption\fP\fR, \fI\fBSDL_WM_SetIcon\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_WM_GrabInput.3 b/docs/man3/SDL_WM_GrabInput.3 new file mode 100644 index 0000000..556681e --- /dev/null +++ b/docs/man3/SDL_WM_GrabInput.3 @@ -0,0 +1,28 @@ +.TH "SDL_WM_GrabInput" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_WM_GrabInput \- Grabs mouse and keyboard input\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBSDL_GrabMode \fBSDL_WM_GrabInput\fP\fR(\fBSDL_GrabMode mode\fR); +.SH "DESCRIPTION" +.PP +Grabbing means that the mouse is confined to the application window, and nearly all keyboard input is passed directly to the application, and not interpreted by a window manager, if any\&. +.PP +When \fBmode\fR is \fBSDL_GRAB_QUERY\fP the grab mode is not changed, but the current grab mode is returned\&. +.PP +.PP +.nf +\f(CWtypedef enum { + SDL_GRAB_QUERY, + SDL_GRAB_OFF, + SDL_GRAB_ON +} SDL_GrabMode;\fR +.fi +.PP + +.SH "RETURN VALUE" +.PP +The current/new \fBSDL_GrabMode\fR\&. +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_WM_IconifyWindow.3 b/docs/man3/SDL_WM_IconifyWindow.3 new file mode 100644 index 0000000..922df8f --- /dev/null +++ b/docs/man3/SDL_WM_IconifyWindow.3 @@ -0,0 +1,15 @@ +.TH "SDL_WM_IconifyWindow" "3" "Tue 11 Sep 2001, 23:02" "SDL" "SDL API Reference" +.SH "NAME" +SDL_WM_IconifyWindow \- Iconify/Minimise the window +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_WM_IconifyWindow\fP\fR(\fBvoid\fR); +.SH "DESCRIPTION" +.PP +If the application is running in a window managed environment SDL attempts to iconify/minimise it\&. If \fBSDL_WM_IconifyWindow\fP is successful, the application will receive a \fI\fBSDL_APPACTIVE\fP\fR loss event\&. +.SH "RETURN VALUE" +.PP +Returns non-zero on success or \fB0\fR if iconification is not support or was refused by the window manager\&. +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:02 diff --git a/docs/man3/SDL_WM_SetCaption.3 b/docs/man3/SDL_WM_SetCaption.3 new file mode 100644 index 0000000..847ff5d --- /dev/null +++ b/docs/man3/SDL_WM_SetCaption.3 @@ -0,0 +1,15 @@ +.TH "SDL_WM_SetCaption" "3" "Tue 11 Sep 2001, 23:02" "SDL" "SDL API Reference" +.SH "NAME" +SDL_WM_SetCaption \- Sets the window tile and icon name\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_WM_SetCaption\fP\fR(\fBconst char *title, const char *icon\fR); +.SH "DESCRIPTION" +.PP +Sets the title-bar and icon name of the display window\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_WM_GetCaption\fP\fR, \fI\fBSDL_WM_SetIcon\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:02 diff --git a/docs/man3/SDL_WM_SetIcon.3 b/docs/man3/SDL_WM_SetIcon.3 new file mode 100644 index 0000000..3f3a519 --- /dev/null +++ b/docs/man3/SDL_WM_SetIcon.3 @@ -0,0 +1,27 @@ +.TH "SDL_WM_SetIcon" "3" "Tue 11 Sep 2001, 23:02" "SDL" "SDL API Reference" +.SH "NAME" +SDL_WM_SetIcon \- Sets the icon for the display window\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_WM_SetIcon\fP\fR(\fBSDL_Surface *icon, Uint8 *mask\fR); +.SH "DESCRIPTION" +.PP +Sets the icon for the display window\&. Win32 icons must be 32x32\&. +.PP +This function must be called before the first call to \fISDL_SetVideoMode\fR\&. +.PP +It takes an \fBicon\fR surface, and a \fBmask\fR in MSB format\&. +.PP +If \fBmask\fR is \fBNULL\fP, the entire icon surface will be used as the icon\&. +.SH "EXAMPLE" +.PP +.nf +\f(CWSDL_WM_SetIcon(SDL_LoadBMP("icon\&.bmp"), NULL);\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_WM_SetCaption\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:02 diff --git a/docs/man3/SDL_WM_ToggleFullScreen.3 b/docs/man3/SDL_WM_ToggleFullScreen.3 new file mode 100644 index 0000000..d4cf8de --- /dev/null +++ b/docs/man3/SDL_WM_ToggleFullScreen.3 @@ -0,0 +1,15 @@ +.TH "SDL_WM_ToggleFullScreen" "3" "Tue 11 Sep 2001, 23:02" "SDL" "SDL API Reference" +.SH "NAME" +SDL_WM_ToggleFullScreen \- Toggles fullscreen mode +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_WM_ToggleFullScreen\fP\fR(\fBSDL_Surface *surface\fR); +.SH "DESCRIPTION" +.PP +Toggles the application between windowed and fullscreen mode, if supported\&. (X11 is the only target currently supported, BeOS support is experimental)\&. +.SH "RETURN VALUE" +.PP +Returns \fB0\fR on failure or \fB1\fR on success\&. +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:02 diff --git a/docs/man3/SDL_WaitEvent.3 b/docs/man3/SDL_WaitEvent.3 new file mode 100644 index 0000000..adadb4a --- /dev/null +++ b/docs/man3/SDL_WaitEvent.3 @@ -0,0 +1,17 @@ +.TH "SDL_WaitEvent" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_WaitEvent \- Waits indefinitely for the next available event\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBint \fBSDL_WaitEvent\fP\fR(\fBSDL_Event *event\fR); +.SH "DESCRIPTION" +.PP +Waits indefinitely for the next available event, returning \fB1\fR, or \fB0\fR if there was an error while waiting for events\&. +.PP +If \fBevent\fR is not \fBNULL\fP, the next event is removed from the queue and stored in that area\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_Event\fR\fR, \fI\fBSDL_PollEvent\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_WaitThread.3 b/docs/man3/SDL_WaitThread.3 new file mode 100644 index 0000000..11679fc --- /dev/null +++ b/docs/man3/SDL_WaitThread.3 @@ -0,0 +1,19 @@ +.TH "SDL_WaitThread" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_WaitThread \- Wait for a thread to finish\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +#include "SDL_thread\&.h" +.sp +\fBvoid \fBSDL_WaitThread\fP\fR(\fBSDL_Thread *thread, int *status\fR); +.SH "DESCRIPTION" +.PP +Wait for a thread to finish (timeouts are not supported)\&. +.SH "RETURN VALUE" +.PP +The return code for the thread function is placed in the area pointed to by \fBstatus\fR, if \fBstatus\fR is not \fBNULL\fR\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_CreateThread\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_WarpMouse.3 b/docs/man3/SDL_WarpMouse.3 new file mode 100644 index 0000000..5cab3ce --- /dev/null +++ b/docs/man3/SDL_WarpMouse.3 @@ -0,0 +1,15 @@ +.TH "SDL_WarpMouse" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_WarpMouse \- Set the position of the mouse cursor\&. +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBvoid \fBSDL_WarpMouse\fP\fR(\fBUint16 x, Uint16 y\fR); +.SH "DESCRIPTION" +.PP +Set the position of the mouse cursor (generates a mouse motion event)\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_MouseMotionEvent\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_WasInit.3 b/docs/man3/SDL_WasInit.3 new file mode 100644 index 0000000..5bc75c5 --- /dev/null +++ b/docs/man3/SDL_WasInit.3 @@ -0,0 +1,63 @@ +.TH "SDL_WasInit" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_WasInit \- Check which subsystems are initialized +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +.sp +\fBUint32 \fBSDL_WasInit\fP\fR(\fBUint32 flags\fR); +.SH "DESCRIPTION" +.PP +\fBSDL_WasInit\fP allows you to see which SDL subsytems have been \fIinitialized\fR\&. \fBflags\fR is a bitwise OR\&'d combination of the subsystems you wish to check (see \fI\fBSDL_Init\fP\fR for a list of subsystem flags)\&. +.SH "RETURN VALUE" +.PP +\fBSDL_WasInit\fP returns a bitwised OR\&'d combination of the initialized subsystems\&. +.SH "EXAMPLES" +.PP +.nf +\f(CW +/* Here are several ways you can use SDL_WasInit() */ + +/* Get init data on all the subsystems */ +Uint32 subsystem_init; + +subsystem_init=SDL_WasInit(SDL_INIT_EVERYTHING); + +if(subsystem_init&SDL_INIT_VIDEO) + printf("Video is initialized\&. +"); +else + printf("Video is not initialized\&. +"); + + + +/* Just check for one specfic subsystem */ + +if(SDL_WasInit(SDL_INIT_VIDEO)!=0) + printf("Video is initialized\&. +"); +else + printf("Video is not initialized\&. +"); + + + + +/* Check for two subsystems */ + +Uint32 subsystem_mask=SDL_INIT_VIDEO|SDL_INIT_AUDIO; + +if(SDL_WasInit(subsystem_mask)==subsystem_mask) + printf("Video and Audio initialized\&. +"); +else + printf("Video and Audio not initialized\&. +"); +\fR +.fi +.PP +.SH "SEE ALSO" +.PP +\fI\fBSDL_Init\fP\fR, \fI\fBSDL_Subsystem\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_keysym.3 b/docs/man3/SDL_keysym.3 new file mode 100644 index 0000000..52065c1 --- /dev/null +++ b/docs/man3/SDL_keysym.3 @@ -0,0 +1,69 @@ +.TH "SDL_keysym" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" +.SH "NAME" +SDL_keysym \- Keysym structure +.SH "STRUCTURE DEFINITION" +.PP +.nf +\f(CWtypedef struct{ + Uint8 scancode; + SDLKey sym; + SDLMod mod; + Uint16 unicode; +} SDL_keysym;\fR +.fi +.PP +.SH "STRUCTURE DATA" +.TP 20 +\fBscancode\fR +Hardware specific scancode +.TP 20 +\fBsym\fR +SDL virtual keysym +.TP 20 +\fBmod\fR +Current key modifiers +.TP 20 +\fBunicode\fR +Translated character +.SH "DESCRIPTION" +.PP +The \fBSDL_keysym\fR structure is used by reporting key presses and releases since it is a part of the \fI\fBSDL_KeyboardEvent\fR\fR\&. +.PP +The \fBscancode\fR field should generally be left alone, it is the hardware dependent scancode returned by the keyboard\&. The \fBsym\fR field is extremely useful\&. It is the SDL-defined value of the key (see \fISDL Key Syms\fR\&. This field is very useful when you are checking for certain key presses, like so: +.PP +.nf +\f(CW\&. +\&. +while(SDL_PollEvent(&event)){ + switch(event\&.type){ + case SDL_KEYDOWN: + if(event\&.key\&.keysym\&.sym==SDLK_LEFT) + move_left(); + break; + \&. + \&. + \&. + } +} +\&. +\&.\fR +.fi +.PP + \fBmod\fR stores the current state of the keyboard modifiers as explained in \fI\fBSDL_GetModState\fP\fR\&. The \fBunicode\fR is only used when UNICODE translation is enabled with \fI\fBSDL_EnableUNICODE\fP\fR\&. If \fBunicode\fR is non-zero then this a the UNICODE character corresponding to the keypress\&. If the high 9 bits of the character are 0, then this maps to the equivalent ASCII character: +.PP +.nf +\f(CWchar ch; +if ( (keysym\&.unicode & 0xFF80) == 0 ) { + ch = keysym\&.unicode & 0x7F; +} +else { + printf("An International Character\&. +"); +}\fR +.fi +.PP + UNICODE translation does have a slight overhead so don\&'t enable it unless its needed\&. +.SH "SEE ALSO" +.PP +\fI\fBSDLKey\fR\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_mutexP.3 b/docs/man3/SDL_mutexP.3 new file mode 100644 index 0000000..3f21716 --- /dev/null +++ b/docs/man3/SDL_mutexP.3 @@ -0,0 +1,18 @@ +.TH "SDL_mutexP" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_mutexP \- Lock a mutex +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +#include "SDL_thread\&.h" +.sp +\fBint \fBSDL_mutexP\fP\fR(\fBSDL_mutex *mutex\fR); +.SH "DESCRIPTION" +.PP +Locks the \fBmutex\fR, which was previously created with \fI\fBSDL_CreateMutex\fP\fR\&. If the mutex is already locked then \fBSDL_mutexP\fP will not return until it is \fIunlocked\fR\&. Returns \fB0\fR on success, or \fB-1\fR on an error\&. +.PP +SDL also defines a macro \fB#define SDL_LockMutex(m) SDL_mutexP(m)\fP\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_CreateMutex\fP\fR, \fI\fBSDL_mutexV\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_mutexV.3 b/docs/man3/SDL_mutexV.3 new file mode 100644 index 0000000..e914abb --- /dev/null +++ b/docs/man3/SDL_mutexV.3 @@ -0,0 +1,18 @@ +.TH "SDL_mutexV" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" +.SH "NAME" +SDL_mutexV \- Unlock a mutex +.SH "SYNOPSIS" +.PP +\fB#include "SDL\&.h" +#include "SDL_thread\&.h" +.sp +\fBint \fBSDL_mutexV\fP\fR(\fBSDL_mutex *mutex\fR); +.SH "DESCRIPTION" +.PP +Unlocks the \fBmutex\fR, which was previously created with \fI\fBSDL_CreateMutex\fP\fR\&. Returns \fB0\fR on success, or \fB-1\fR on an error\&. +.PP +SDL also defines a macro \fB#define SDL_UnlockMutex(m) SDL_mutexV(m)\fP\&. +.SH "SEE ALSO" +.PP +\fI\fBSDL_CreateMutex\fP\fR, \fI\fBSDL_mutexP\fP\fR +.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/include/SDL.h b/include/SDL.h new file mode 100644 index 0000000..119ed7f --- /dev/null +++ b/include/SDL.h @@ -0,0 +1,101 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL.h + * Main include header for the SDL library + */ + +#ifndef _SDL_H +#define _SDL_H + +#include "SDL_main.h" +#include "SDL_stdinc.h" +#include "SDL_audio.h" +#include "SDL_cdrom.h" +#include "SDL_cpuinfo.h" +#include "SDL_endian.h" +#include "SDL_error.h" +#include "SDL_events.h" +#include "SDL_loadso.h" +#include "SDL_mutex.h" +#include "SDL_rwops.h" +#include "SDL_thread.h" +#include "SDL_timer.h" +#include "SDL_video.h" +#include "SDL_version.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @file SDL.h + * @note As of version 0.5, SDL is loaded dynamically into the application + */ + +/** @name SDL_INIT Flags + * These are the flags which may be passed to SDL_Init() -- you should + * specify the subsystems which you will be using in your application. + */ +/*@{*/ +#define SDL_INIT_TIMER 0x00000001 +#define SDL_INIT_AUDIO 0x00000010 +#define SDL_INIT_VIDEO 0x00000020 +#define SDL_INIT_CDROM 0x00000100 +#define SDL_INIT_JOYSTICK 0x00000200 +#define SDL_INIT_NOPARACHUTE 0x00100000 /**< Don't catch fatal signals */ +#define SDL_INIT_EVENTTHREAD 0x01000000 /**< Not supported on all OS's */ +#define SDL_INIT_EVERYTHING 0x0000FFFF +/*@}*/ + +/** This function loads the SDL dynamically linked library and initializes + * the subsystems specified by 'flags' (and those satisfying dependencies) + * Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup + * signal handlers for some commonly ignored fatal signals (like SIGSEGV) + */ +extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); + +/** This function initializes specific SDL subsystems */ +extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); + +/** This function cleans up specific SDL subsystems */ +extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); + +/** This function returns mask of the specified subsystems which have + * been initialized. + * If 'flags' is 0, it returns a mask of all initialized subsystems. + */ +extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); + +/** This function cleans up all initialized subsystems and unloads the + * dynamically linked library. You should call it upon all exit conditions. + */ +extern DECLSPEC void SDLCALL SDL_Quit(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_H */ diff --git a/include/SDL_active.h b/include/SDL_active.h new file mode 100644 index 0000000..0ae92f2 --- /dev/null +++ b/include/SDL_active.h @@ -0,0 +1,63 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_active.h + * Include file for SDL application focus event handling + */ + +#ifndef _SDL_active_h +#define _SDL_active_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @name The available application states */ +/*@{*/ +#define SDL_APPMOUSEFOCUS 0x01 /**< The app has mouse coverage */ +#define SDL_APPINPUTFOCUS 0x02 /**< The app has input focus */ +#define SDL_APPACTIVE 0x04 /**< The application is active */ +/*@}*/ + +/* Function prototypes */ +/** + * This function returns the current state of the application, which is a + * bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and + * SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to + * see your application, otherwise it has been iconified or disabled. + */ +extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_active_h */ diff --git a/include/SDL_audio.h b/include/SDL_audio.h new file mode 100644 index 0000000..3a8e7fa --- /dev/null +++ b/include/SDL_audio.h @@ -0,0 +1,284 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_audio.h + * Access to the raw audio mixing buffer for the SDL library + */ + +#ifndef _SDL_audio_h +#define _SDL_audio_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_endian.h" +#include "SDL_mutex.h" +#include "SDL_thread.h" +#include "SDL_rwops.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * When filling in the desired audio spec structure, + * - 'desired->freq' should be the desired audio frequency in samples-per-second. + * - 'desired->format' should be the desired audio format. + * - 'desired->samples' is the desired size of the audio buffer, in samples. + * This number should be a power of two, and may be adjusted by the audio + * driver to a value more suitable for the hardware. Good values seem to + * range between 512 and 8096 inclusive, depending on the application and + * CPU speed. Smaller values yield faster response time, but can lead + * to underflow if the application is doing heavy processing and cannot + * fill the audio buffer in time. A stereo sample consists of both right + * and left channels in LR ordering. + * Note that the number of samples is directly related to time by the + * following formula: ms = (samples*1000)/freq + * - 'desired->size' is the size in bytes of the audio buffer, and is + * calculated by SDL_OpenAudio(). + * - 'desired->silence' is the value used to set the buffer to silence, + * and is calculated by SDL_OpenAudio(). + * - 'desired->callback' should be set to a function that will be called + * when the audio device is ready for more data. It is passed a pointer + * to the audio buffer, and the length in bytes of the audio buffer. + * This function usually runs in a separate thread, and so you should + * protect data structures that it accesses by calling SDL_LockAudio() + * and SDL_UnlockAudio() in your code. + * - 'desired->userdata' is passed as the first parameter to your callback + * function. + * + * @note The calculated values in this structure are calculated by SDL_OpenAudio() + * + */ +typedef struct SDL_AudioSpec { + int freq; /**< DSP frequency -- samples per second */ + Uint16 format; /**< Audio data format */ + Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */ + Uint8 silence; /**< Audio buffer silence value (calculated) */ + Uint16 samples; /**< Audio buffer size in samples (power of 2) */ + Uint16 padding; /**< Necessary for some compile environments */ + Uint32 size; /**< Audio buffer size in bytes (calculated) */ + /** + * This function is called when the audio device needs more data. + * + * @param[out] stream A pointer to the audio data buffer + * @param[in] len The length of the audio buffer in bytes. + * + * Once the callback returns, the buffer will no longer be valid. + * Stereo samples are stored in a LRLRLR ordering. + */ + void (SDLCALL *callback)(void *userdata, Uint8 *stream, int len); + void *userdata; +} SDL_AudioSpec; + +/** + * @name Audio format flags + * defaults to LSB byte order + */ +/*@{*/ +#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */ +#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */ +#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */ +#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */ +#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */ +#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */ +#define AUDIO_U16 AUDIO_U16LSB +#define AUDIO_S16 AUDIO_S16LSB + +/** + * @name Native audio byte ordering + */ +/*@{*/ +#if SDL_BYTEORDER == SDL_LIL_ENDIAN +#define AUDIO_U16SYS AUDIO_U16LSB +#define AUDIO_S16SYS AUDIO_S16LSB +#else +#define AUDIO_U16SYS AUDIO_U16MSB +#define AUDIO_S16SYS AUDIO_S16MSB +#endif +/*@}*/ + +/*@}*/ + + +/** A structure to hold a set of audio conversion filters and buffers */ +typedef struct SDL_AudioCVT { + int needed; /**< Set to 1 if conversion possible */ + Uint16 src_format; /**< Source audio format */ + Uint16 dst_format; /**< Target audio format */ + double rate_incr; /**< Rate conversion increment */ + Uint8 *buf; /**< Buffer to hold entire audio data */ + int len; /**< Length of original audio buffer */ + int len_cvt; /**< Length of converted audio buffer */ + int len_mult; /**< buffer must be len*len_mult big */ + double len_ratio; /**< Given len, final size is len*len_ratio */ + void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format); + int filter_index; /**< Current audio conversion function */ +} SDL_AudioCVT; + + +/* Function prototypes */ + +/** + * @name Audio Init and Quit + * These functions are used internally, and should not be used unless you + * have a specific need to specify the audio driver you want to use. + * You should normally use SDL_Init() or SDL_InitSubSystem(). + */ +/*@{*/ +extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name); +extern DECLSPEC void SDLCALL SDL_AudioQuit(void); +/*@}*/ + +/** + * This function fills the given character buffer with the name of the + * current audio driver, and returns a pointer to it if the audio driver has + * been initialized. It returns NULL if no driver has been initialized. + */ +extern DECLSPEC char * SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen); + +/** + * This function opens the audio device with the desired parameters, and + * returns 0 if successful, placing the actual hardware parameters in the + * structure pointed to by 'obtained'. If 'obtained' is NULL, the audio + * data passed to the callback function will be guaranteed to be in the + * requested format, and will be automatically converted to the hardware + * audio format if necessary. This function returns -1 if it failed + * to open the audio device, or couldn't set up the audio thread. + * + * The audio device starts out playing silence when it's opened, and should + * be enabled for playing by calling SDL_PauseAudio(0) when you are ready + * for your audio callback function to be called. Since the audio driver + * may modify the requested size of the audio buffer, you should allocate + * any local mixing buffers after you open the audio device. + * + * @sa SDL_AudioSpec + */ +extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained); + +typedef enum { + SDL_AUDIO_STOPPED = 0, + SDL_AUDIO_PLAYING, + SDL_AUDIO_PAUSED +} SDL_audiostatus; + +/** Get the current audio state */ +extern DECLSPEC SDL_audiostatus SDLCALL SDL_GetAudioStatus(void); + +/** + * This function pauses and unpauses the audio callback processing. + * It should be called with a parameter of 0 after opening the audio + * device to start playing sound. This is so you can safely initialize + * data for your callback function after opening the audio device. + * Silence will be written to the audio device during the pause. + */ +extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on); + +/** + * This function loads a WAVE from the data source, automatically freeing + * that source if 'freesrc' is non-zero. For example, to load a WAVE file, + * you could do: + * @code SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); @endcode + * + * If this function succeeds, it returns the given SDL_AudioSpec, + * filled with the audio data format of the wave data, and sets + * 'audio_buf' to a malloc()'d buffer containing the audio data, + * and sets 'audio_len' to the length of that audio buffer, in bytes. + * You need to free the audio buffer with SDL_FreeWAV() when you are + * done with it. + * + * This function returns NULL and sets the SDL error message if the + * wave file cannot be opened, uses an unknown data format, or is + * corrupt. Currently raw and MS-ADPCM WAVE files are supported. + */ +extern DECLSPEC SDL_AudioSpec * SDLCALL SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); + +/** Compatibility convenience function -- loads a WAV from a file */ +#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ + SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len) + +/** + * This function frees data previously allocated with SDL_LoadWAV_RW() + */ +extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 *audio_buf); + +/** + * This function takes a source format and rate and a destination format + * and rate, and initializes the 'cvt' structure with information needed + * by SDL_ConvertAudio() to convert a buffer of audio data from one format + * to the other. + * + * @return This function returns 0, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT *cvt, + Uint16 src_format, Uint8 src_channels, int src_rate, + Uint16 dst_format, Uint8 dst_channels, int dst_rate); + +/** + * Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(), + * created an audio buffer cvt->buf, and filled it with cvt->len bytes of + * audio data in the source format, this function will convert it in-place + * to the desired format. + * The data conversion may expand the size of the audio data, so the buffer + * cvt->buf should be allocated after the cvt structure is initialized by + * SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long. + */ +extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT *cvt); + + +#define SDL_MIX_MAXVOLUME 128 +/** + * This takes two audio buffers of the playing audio format and mixes + * them, performing addition, volume adjustment, and overflow clipping. + * The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME + * for full audio volume. Note this does not change hardware volume. + * This is provided for convenience -- you can mix your own audio data. + */ +extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume); + +/** + * @name Audio Locks + * The lock manipulated by these functions protects the callback function. + * During a LockAudio/UnlockAudio pair, you can be guaranteed that the + * callback function is not running. Do not call these from the callback + * function or you will cause deadlock. + */ +/*@{*/ +extern DECLSPEC void SDLCALL SDL_LockAudio(void); +extern DECLSPEC void SDLCALL SDL_UnlockAudio(void); +/*@}*/ + +/** + * This function shuts down audio processing and closes the audio device. + */ +extern DECLSPEC void SDLCALL SDL_CloseAudio(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_audio_h */ diff --git a/include/SDL_byteorder.h b/include/SDL_byteorder.h new file mode 100644 index 0000000..9b93cd6 --- /dev/null +++ b/include/SDL_byteorder.h @@ -0,0 +1,29 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_byteorder.h + * @deprecated Use SDL_endian.h instead + */ + +/* DEPRECATED */ +#include "SDL_endian.h" diff --git a/include/SDL_cdrom.h b/include/SDL_cdrom.h new file mode 100644 index 0000000..fff5cfa --- /dev/null +++ b/include/SDL_cdrom.h @@ -0,0 +1,202 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_cdrom.h + * This is the CD-audio control API for Simple DirectMedia Layer + */ + +#ifndef _SDL_cdrom_h +#define _SDL_cdrom_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file SDL_cdrom.h + * In order to use these functions, SDL_Init() must have been called + * with the SDL_INIT_CDROM flag. This causes SDL to scan the system + * for CD-ROM drives, and load appropriate drivers. + */ + +/** The maximum number of CD-ROM tracks on a disk */ +#define SDL_MAX_TRACKS 99 + +/** @name Track Types + * The types of CD-ROM track possible + */ +/*@{*/ +#define SDL_AUDIO_TRACK 0x00 +#define SDL_DATA_TRACK 0x04 +/*@}*/ + +/** The possible states which a CD-ROM drive can be in. */ +typedef enum { + CD_TRAYEMPTY, + CD_STOPPED, + CD_PLAYING, + CD_PAUSED, + CD_ERROR = -1 +} CDstatus; + +/** Given a status, returns true if there's a disk in the drive */ +#define CD_INDRIVE(status) ((int)(status) > 0) + +typedef struct SDL_CDtrack { + Uint8 id; /**< Track number */ + Uint8 type; /**< Data or audio track */ + Uint16 unused; + Uint32 length; /**< Length, in frames, of this track */ + Uint32 offset; /**< Offset, in frames, from start of disk */ +} SDL_CDtrack; + +/** This structure is only current as of the last call to SDL_CDStatus() */ +typedef struct SDL_CD { + int id; /**< Private drive identifier */ + CDstatus status; /**< Current drive status */ + + /** The rest of this structure is only valid if there's a CD in drive */ + /*@{*/ + int numtracks; /**< Number of tracks on disk */ + int cur_track; /**< Current track position */ + int cur_frame; /**< Current frame offset within current track */ + SDL_CDtrack track[SDL_MAX_TRACKS+1]; + /*@}*/ +} SDL_CD; + +/** @name Frames / MSF Conversion Functions + * Conversion functions from frames to Minute/Second/Frames and vice versa + */ +/*@{*/ +#define CD_FPS 75 +#define FRAMES_TO_MSF(f, M,S,F) { \ + int value = f; \ + *(F) = value%CD_FPS; \ + value /= CD_FPS; \ + *(S) = value%60; \ + value /= 60; \ + *(M) = value; \ +} +#define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F)) +/*@}*/ + +/* CD-audio API functions: */ + +/** + * Returns the number of CD-ROM drives on the system, or -1 if + * SDL_Init() has not been called with the SDL_INIT_CDROM flag. + */ +extern DECLSPEC int SDLCALL SDL_CDNumDrives(void); + +/** + * Returns a human-readable, system-dependent identifier for the CD-ROM. + * Example: + * - "/dev/cdrom" + * - "E:" + * - "/dev/disk/ide/1/master" + */ +extern DECLSPEC const char * SDLCALL SDL_CDName(int drive); + +/** + * Opens a CD-ROM drive for access. It returns a drive handle on success, + * or NULL if the drive was invalid or busy. This newly opened CD-ROM + * becomes the default CD used when other CD functions are passed a NULL + * CD-ROM handle. + * Drives are numbered starting with 0. Drive 0 is the system default CD-ROM. + */ +extern DECLSPEC SDL_CD * SDLCALL SDL_CDOpen(int drive); + +/** + * This function returns the current status of the given drive. + * If the drive has a CD in it, the table of contents of the CD and current + * play position of the CD will be stored in the SDL_CD structure. + */ +extern DECLSPEC CDstatus SDLCALL SDL_CDStatus(SDL_CD *cdrom); + +/** + * Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks' + * tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play + * until the end of the CD. This function will skip data tracks. + * This function should only be called after calling SDL_CDStatus() to + * get track information about the CD. + * For example: + * @code + * // Play entire CD: + * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) + * SDL_CDPlayTracks(cdrom, 0, 0, 0, 0); + * // Play last track: + * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) { + * SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0); + * } + * // Play first and second track and 10 seconds of third track: + * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) + * SDL_CDPlayTracks(cdrom, 0, 0, 2, 10); + * @endcode + * + * @return This function returns 0, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD *cdrom, + int start_track, int start_frame, int ntracks, int nframes); + +/** + * Play the given CD starting at 'start' frame for 'length' frames. + * @return It returns 0, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_CDPlay(SDL_CD *cdrom, int start, int length); + +/** Pause play + * @return returns 0, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_CDPause(SDL_CD *cdrom); + +/** Resume play + * @return returns 0, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_CDResume(SDL_CD *cdrom); + +/** Stop play + * @return returns 0, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_CDStop(SDL_CD *cdrom); + +/** Eject CD-ROM + * @return returns 0, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_CDEject(SDL_CD *cdrom); + +/** Closes the handle for the CD-ROM drive */ +extern DECLSPEC void SDLCALL SDL_CDClose(SDL_CD *cdrom); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_video_h */ diff --git a/include/SDL_config.h.default b/include/SDL_config.h.default new file mode 100644 index 0000000..a508101 --- /dev/null +++ b/include/SDL_config.h.default @@ -0,0 +1,45 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_h +#define _SDL_config_h + +#include "SDL_platform.h" + +/* Add any platform that doesn't build using the configure system */ +#if defined(__DREAMCAST__) +#include "SDL_config_dreamcast.h" +#elif defined(__MACOS__) +#include "SDL_config_macos.h" +#elif defined(__MACOSX__) +#include "SDL_config_macosx.h" +#elif defined(__SYMBIAN32__) +#include "SDL_config_symbian.h" /* must be before win32! */ +#elif defined(__WIN32__) +#include "SDL_config_win32.h" +#elif defined(__OS2__) +#include "SDL_config_os2.h" +#else +#include "SDL_config_minimal.h" +#endif /* platform config */ + +#endif /* _SDL_config_h */ diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in new file mode 100644 index 0000000..58593ca --- /dev/null +++ b/include/SDL_config.h.in @@ -0,0 +1,310 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_h +#define _SDL_config_h + +/* This is a set of defines to configure the SDL features */ + +/* General platform specific identifiers */ +#include "SDL_platform.h" + +/* Make sure that this isn't included by Visual C++ */ +#ifdef _MSC_VER +#error You should copy include/SDL_config.h.default to include/SDL_config.h +#endif + +/* C language features */ +#undef const +#undef inline +#undef volatile + +/* C datatypes */ +#undef size_t +#undef int8_t +#undef uint8_t +#undef int16_t +#undef uint16_t +#undef int32_t +#undef uint32_t +#undef int64_t +#undef uint64_t +#undef uintptr_t +#undef SDL_HAS_64BIT_TYPE + +/* Endianness */ +#undef SDL_BYTEORDER + +/* Comment this if you want to build without any C library requirements */ +#undef HAVE_LIBC +#if HAVE_LIBC + +/* Useful headers */ +#undef HAVE_ALLOCA_H +#undef HAVE_SYS_TYPES_H +#undef HAVE_STDIO_H +#undef STDC_HEADERS +#undef HAVE_STDLIB_H +#undef HAVE_STDARG_H +#undef HAVE_MALLOC_H +#undef HAVE_MEMORY_H +#undef HAVE_STRING_H +#undef HAVE_STRINGS_H +#undef HAVE_INTTYPES_H +#undef HAVE_STDINT_H +#undef HAVE_CTYPE_H +#undef HAVE_MATH_H +#undef HAVE_ICONV_H +#undef HAVE_SIGNAL_H +#undef HAVE_ALTIVEC_H + +/* C library functions */ +#undef HAVE_MALLOC +#undef HAVE_CALLOC +#undef HAVE_REALLOC +#undef HAVE_FREE +#undef HAVE_ALLOCA +#ifndef _WIN32 /* Don't use C runtime versions of these on Windows */ +#undef HAVE_GETENV +#undef HAVE_PUTENV +#undef HAVE_UNSETENV +#endif +#undef HAVE_QSORT +#undef HAVE_ABS +#undef HAVE_BCOPY +#undef HAVE_MEMSET +#undef HAVE_MEMCPY +#undef HAVE_MEMMOVE +#undef HAVE_MEMCMP +#undef HAVE_STRLEN +#undef HAVE_STRLCPY +#undef HAVE_STRLCAT +#undef HAVE_STRDUP +#undef HAVE__STRREV +#undef HAVE__STRUPR +#undef HAVE__STRLWR +#undef HAVE_INDEX +#undef HAVE_RINDEX +#undef HAVE_STRCHR +#undef HAVE_STRRCHR +#undef HAVE_STRSTR +#undef HAVE_ITOA +#undef HAVE__LTOA +#undef HAVE__UITOA +#undef HAVE__ULTOA +#undef HAVE_STRTOL +#undef HAVE_STRTOUL +#undef HAVE__I64TOA +#undef HAVE__UI64TOA +#undef HAVE_STRTOLL +#undef HAVE_STRTOULL +#undef HAVE_STRTOD +#undef HAVE_ATOI +#undef HAVE_ATOF +#undef HAVE_STRCMP +#undef HAVE_STRNCMP +#undef HAVE__STRICMP +#undef HAVE_STRCASECMP +#undef HAVE__STRNICMP +#undef HAVE_STRNCASECMP +#undef HAVE_SSCANF +#undef HAVE_SNPRINTF +#undef HAVE_VSNPRINTF +#undef HAVE_ICONV +#undef HAVE_SIGACTION +#undef HAVE_SETJMP +#undef HAVE_NANOSLEEP +#undef HAVE_CLOCK_GETTIME +#undef HAVE_GETPAGESIZE +#undef HAVE_MPROTECT + +#else +/* We may need some replacement for stdarg.h here */ +#include +#endif /* HAVE_LIBC */ + +/* Allow disabling of core subsystems */ +#undef SDL_AUDIO_DISABLED +#undef SDL_CDROM_DISABLED +#undef SDL_CPUINFO_DISABLED +#undef SDL_EVENTS_DISABLED +#undef SDL_FILE_DISABLED +#undef SDL_JOYSTICK_DISABLED +#undef SDL_LOADSO_DISABLED +#undef SDL_THREADS_DISABLED +#undef SDL_TIMERS_DISABLED +#undef SDL_VIDEO_DISABLED + +/* Enable various audio drivers */ +#undef SDL_AUDIO_DRIVER_ALSA +#undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC +#undef SDL_AUDIO_DRIVER_ARTS +#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC +#undef SDL_AUDIO_DRIVER_BAUDIO +#undef SDL_AUDIO_DRIVER_BSD +#undef SDL_AUDIO_DRIVER_COREAUDIO +#undef SDL_AUDIO_DRIVER_DART +#undef SDL_AUDIO_DRIVER_DC +#undef SDL_AUDIO_DRIVER_DISK +#undef SDL_AUDIO_DRIVER_DUMMY +#undef SDL_AUDIO_DRIVER_DMEDIA +#undef SDL_AUDIO_DRIVER_DSOUND +#undef SDL_AUDIO_DRIVER_PULSE +#undef SDL_AUDIO_DRIVER_PULSE_DYNAMIC +#undef SDL_AUDIO_DRIVER_ESD +#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC +#undef SDL_AUDIO_DRIVER_MINT +#undef SDL_AUDIO_DRIVER_MMEAUDIO +#undef SDL_AUDIO_DRIVER_NAS +#undef SDL_AUDIO_DRIVER_NAS_DYNAMIC +#undef SDL_AUDIO_DRIVER_OSS +#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H +#undef SDL_AUDIO_DRIVER_PAUD +#undef SDL_AUDIO_DRIVER_QNXNTO +#undef SDL_AUDIO_DRIVER_SNDMGR +#undef SDL_AUDIO_DRIVER_SUNAUDIO +#undef SDL_AUDIO_DRIVER_WAVEOUT + +/* Enable various cdrom drivers */ +#undef SDL_CDROM_AIX +#undef SDL_CDROM_BEOS +#undef SDL_CDROM_BSDI +#undef SDL_CDROM_DC +#undef SDL_CDROM_DUMMY +#undef SDL_CDROM_FREEBSD +#undef SDL_CDROM_LINUX +#undef SDL_CDROM_MACOS +#undef SDL_CDROM_MACOSX +#undef SDL_CDROM_MINT +#undef SDL_CDROM_OPENBSD +#undef SDL_CDROM_OS2 +#undef SDL_CDROM_OSF +#undef SDL_CDROM_QNX +#undef SDL_CDROM_WIN32 + +/* Enable various input drivers */ +#undef SDL_INPUT_LINUXEV +#undef SDL_INPUT_TSLIB +#undef SDL_JOYSTICK_BEOS +#undef SDL_JOYSTICK_DC +#undef SDL_JOYSTICK_DUMMY +#undef SDL_JOYSTICK_IOKIT +#undef SDL_JOYSTICK_LINUX +#undef SDL_JOYSTICK_MACOS +#undef SDL_JOYSTICK_MINT +#undef SDL_JOYSTICK_OS2 +#undef SDL_JOYSTICK_RISCOS +#undef SDL_JOYSTICK_WINMM +#undef SDL_JOYSTICK_USBHID +#undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H + +/* Enable various shared object loading systems */ +#undef SDL_LOADSO_BEOS +#undef SDL_LOADSO_DLCOMPAT +#undef SDL_LOADSO_DLOPEN +#undef SDL_LOADSO_DUMMY +#undef SDL_LOADSO_LDG +#undef SDL_LOADSO_MACOS +#undef SDL_LOADSO_OS2 +#undef SDL_LOADSO_WIN32 + +/* Enable various threading systems */ +#undef SDL_THREAD_BEOS +#undef SDL_THREAD_DC +#undef SDL_THREAD_OS2 +#undef SDL_THREAD_PTH +#undef SDL_THREAD_PTHREAD +#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX +#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP +#undef SDL_THREAD_SPROC +#undef SDL_THREAD_WIN32 + +/* Enable various timer systems */ +#undef SDL_TIMER_BEOS +#undef SDL_TIMER_DC +#undef SDL_TIMER_DUMMY +#undef SDL_TIMER_MACOS +#undef SDL_TIMER_MINT +#undef SDL_TIMER_OS2 +#undef SDL_TIMER_RISCOS +#undef SDL_TIMER_UNIX +#undef SDL_TIMER_WIN32 +#undef SDL_TIMER_WINCE + +/* Enable various video drivers */ +#undef SDL_VIDEO_DRIVER_AALIB +#undef SDL_VIDEO_DRIVER_BWINDOW +#undef SDL_VIDEO_DRIVER_CACA +#undef SDL_VIDEO_DRIVER_DC +#undef SDL_VIDEO_DRIVER_DDRAW +#undef SDL_VIDEO_DRIVER_DGA +#undef SDL_VIDEO_DRIVER_DIRECTFB +#undef SDL_VIDEO_DRIVER_DRAWSPROCKET +#undef SDL_VIDEO_DRIVER_DUMMY +#undef SDL_VIDEO_DRIVER_FBCON +#undef SDL_VIDEO_DRIVER_GAPI +#undef SDL_VIDEO_DRIVER_GEM +#undef SDL_VIDEO_DRIVER_GGI +#undef SDL_VIDEO_DRIVER_IPOD +#undef SDL_VIDEO_DRIVER_NANOX +#undef SDL_VIDEO_DRIVER_OS2FS +#undef SDL_VIDEO_DRIVER_PHOTON +#undef SDL_VIDEO_DRIVER_PICOGUI +#undef SDL_VIDEO_DRIVER_PS2GS +#undef SDL_VIDEO_DRIVER_PS3 +#undef SDL_VIDEO_DRIVER_QTOPIA +#undef SDL_VIDEO_DRIVER_QUARTZ +#undef SDL_VIDEO_DRIVER_RISCOS +#undef SDL_VIDEO_DRIVER_SVGALIB +#undef SDL_VIDEO_DRIVER_TOOLBOX +#undef SDL_VIDEO_DRIVER_VGL +#undef SDL_VIDEO_DRIVER_WINDIB +#undef SDL_VIDEO_DRIVER_WSCONS +#undef SDL_VIDEO_DRIVER_X11 +#undef SDL_VIDEO_DRIVER_X11_DGAMOUSE +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER +#undef SDL_VIDEO_DRIVER_X11_VIDMODE +#undef SDL_VIDEO_DRIVER_X11_XINERAMA +#undef SDL_VIDEO_DRIVER_X11_XME +#undef SDL_VIDEO_DRIVER_X11_XRANDR +#undef SDL_VIDEO_DRIVER_X11_XV +#undef SDL_VIDEO_DRIVER_XBIOS + +/* Enable OpenGL support */ +#undef SDL_VIDEO_OPENGL +#undef SDL_VIDEO_OPENGL_GLX +#undef SDL_VIDEO_OPENGL_WGL +#undef SDL_VIDEO_OPENGL_OSMESA +#undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC + +/* Disable screensaver */ +#undef SDL_VIDEO_DISABLE_SCREENSAVER + +/* Enable assembly routines */ +#undef SDL_ASSEMBLY_ROUTINES +#undef SDL_HERMES_BLITTERS +#undef SDL_ALTIVEC_BLITTERS + +#endif /* _SDL_config_h */ diff --git a/include/SDL_config_dreamcast.h b/include/SDL_config_dreamcast.h new file mode 100644 index 0000000..07c2f08 --- /dev/null +++ b/include/SDL_config_dreamcast.h @@ -0,0 +1,106 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_dreamcast_h +#define _SDL_config_dreamcast_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +typedef unsigned long uintptr_t; +#define SDL_HAS_64BIT_TYPE 1 + +/* Useful headers */ +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_CTYPE_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRDUP 1 +#define HAVE_INDEX 1 +#define HAVE_RINDEX 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRICMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_DC 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various cdrom drivers */ +#define SDL_CDROM_DC 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_DC 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_DUMMY 1 + +/* Enable various threading systems */ +#define SDL_THREAD_DC 1 + +/* Enable various timer systems */ +#define SDL_TIMER_DC 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DC 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 + +#endif /* _SDL_config_dreamcast_h */ diff --git a/include/SDL_config_macos.h b/include/SDL_config_macos.h new file mode 100644 index 0000000..4ba5c22 --- /dev/null +++ b/include/SDL_config_macos.h @@ -0,0 +1,112 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_macos_h +#define _SDL_config_macos_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +#include + +typedef SInt8 int8_t; +typedef UInt8 uint8_t; +typedef SInt16 int16_t; +typedef UInt16 uint16_t; +typedef SInt32 int32_t; +typedef UInt32 uint32_t; +typedef SInt64 int64_t; +typedef UInt64 uint64_t; +typedef unsigned long uintptr_t; + +#define SDL_HAS_64BIT_TYPE 1 + +/* Useful headers */ +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_ITOA 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_SSCANF 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_SNDMGR 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various cdrom drivers */ +#if TARGET_API_MAC_CARBON +#define SDL_CDROM_DUMMY 1 +#else +#define SDL_CDROM_MACOS 1 +#endif + +/* Enable various input drivers */ +#if TARGET_API_MAC_CARBON +#define SDL_JOYSTICK_DUMMY 1 +#else +#define SDL_JOYSTICK_MACOS 1 +#endif + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_MACOS 1 + +/* Enable various threading systems */ +#define SDL_THREADS_DISABLED 1 + +/* Enable various timer systems */ +#define SDL_TIMER_MACOS 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_DRAWSPROCKET 1 +#define SDL_VIDEO_DRIVER_TOOLBOX 1 + +/* Enable OpenGL support */ +#define SDL_VIDEO_OPENGL 1 + +#endif /* _SDL_config_macos_h */ diff --git a/include/SDL_config_macosx.h b/include/SDL_config_macosx.h new file mode 100644 index 0000000..295b872 --- /dev/null +++ b/include/SDL_config_macosx.h @@ -0,0 +1,150 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_macosx_h +#define _SDL_config_macosx_h + +#include "SDL_platform.h" + +/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */ +#include + +/* This is a set of defines to configure the SDL features */ + +#define SDL_HAS_64BIT_TYPE 1 + +/* Useful headers */ +/* If we specified an SDK or have a post-PowerPC chip, then alloca.h exists. */ +#if ( (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (!defined(__POWERPC__)) ) +#define HAVE_ALLOCA_H 1 +#endif +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRDUP 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_COREAUDIO 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various cdrom drivers */ +#define SDL_CDROM_MACOSX 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_IOKIT 1 + +/* Enable various shared object loading systems */ +#ifdef __ppc__ +/* For Mac OS X 10.2 compatibility */ +#define SDL_LOADSO_DLCOMPAT 1 +#else +#define SDL_LOADSO_DLOPEN 1 +#endif + +/* Enable various threading systems */ +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 + +/* Enable various timer systems */ +#define SDL_TIMER_UNIX 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +#if ((defined TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON)) +#define SDL_VIDEO_DRIVER_TOOLBOX 1 +#else +#define SDL_VIDEO_DRIVER_QUARTZ 1 +#endif +#define SDL_VIDEO_DRIVER_DGA 1 +#define SDL_VIDEO_DRIVER_X11 1 +#define SDL_VIDEO_DRIVER_X11_DGAMOUSE 1 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER "/usr/X11R6/lib/libXrender.1.dylib" +#define SDL_VIDEO_DRIVER_X11_VIDMODE 1 +#define SDL_VIDEO_DRIVER_X11_XINERAMA 1 +#define SDL_VIDEO_DRIVER_X11_XME 1 +#define SDL_VIDEO_DRIVER_X11_XRANDR 1 +#define SDL_VIDEO_DRIVER_X11_XV 1 + +/* Enable OpenGL support */ +#define SDL_VIDEO_OPENGL 1 +#define SDL_VIDEO_OPENGL_GLX 1 + +/* Disable screensaver */ +#define SDL_VIDEO_DISABLE_SCREENSAVER 1 + +/* Enable assembly routines */ +#define SDL_ASSEMBLY_ROUTINES 1 +#ifdef __ppc__ +#define SDL_ALTIVEC_BLITTERS 1 +#endif + +#endif /* _SDL_config_macosx_h */ diff --git a/include/SDL_config_minimal.h b/include/SDL_config_minimal.h new file mode 100644 index 0000000..002c56e --- /dev/null +++ b/include/SDL_config_minimal.h @@ -0,0 +1,62 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_minimal_h +#define _SDL_config_minimal_h + +#include "SDL_platform.h" + +/* This is the minimal configuration that can be used to build SDL */ + +#include + +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef unsigned int size_t; +typedef unsigned long uintptr_t; + +/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ +#define SDL_CDROM_DISABLED 1 + +/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ +#define SDL_JOYSTICK_DISABLED 1 + +/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ +#define SDL_LOADSO_DISABLED 1 + +/* Enable the stub thread support (src/thread/generic/\*.c) */ +#define SDL_THREADS_DISABLED 1 + +/* Enable the stub timer support (src/timer/dummy/\*.c) */ +#define SDL_TIMERS_DISABLED 1 + +/* Enable the dummy video driver (src/video/dummy/\*.c) */ +#define SDL_VIDEO_DRIVER_DUMMY 1 + +#endif /* _SDL_config_minimal_h */ diff --git a/include/SDL_config_nds.h b/include/SDL_config_nds.h new file mode 100644 index 0000000..4ac60a5 --- /dev/null +++ b/include/SDL_config_nds.h @@ -0,0 +1,115 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_nds_h +#define _SDL_config_nds_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +/* General platform specific identifiers */ +#include "SDL_platform.h" + +/* C datatypes */ +#define SDL_HAS_64BIT_TYPE 1 + +/* Endianness */ +#define SDL_BYTEORDER 1234 + +/* Useful headers */ +#define HAVE_ALLOCA_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_STRING_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_ICONV_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRDUP 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_SETJMP 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_NDS 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ +#define SDL_CDROM_DISABLED 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_NDS 1 + +/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ +#define SDL_LOADSO_DISABLED 1 + +/* Enable the stub thread support (src/thread/generic/\*.c) */ +#define SDL_THREADS_DISABLED 1 + +/* Enable various timer systems */ +#define SDL_TIMER_NDS 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_NDS 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 + +#endif /* _SDL_config_nds_h */ diff --git a/include/SDL_config_os2.h b/include/SDL_config_os2.h new file mode 100644 index 0000000..bb40df0 --- /dev/null +++ b/include/SDL_config_os2.h @@ -0,0 +1,141 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_os2_h +#define _SDL_config_os2_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef unsigned int size_t; +typedef unsigned long uintptr_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; + +#define SDL_HAS_64BIT_TYPE 1 + +/* Use Watcom's LIBC */ +#define HAVE_LIBC 1 + +/* Useful headers */ +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_STRING_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRDUP 1 +#define HAVE__STRREV 1 +#define HAVE__STRUPR 1 +#define HAVE__STRLWR 1 +#define HAVE_INDEX 1 +#define HAVE_RINDEX 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_ITOA 1 +#define HAVE__LTOA 1 +#define HAVE__UITOA 1 +#define HAVE__ULTOA 1 +#define HAVE_STRTOL 1 +#define HAVE__I64TOA 1 +#define HAVE__UI64TOA 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRICMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_SETJMP 1 +#define HAVE_CLOCK_GETTIME 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_DART 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various cdrom drivers */ +#define SDL_CDROM_OS2 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_OS2 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_OS2 1 + +/* Enable various threading systems */ +#define SDL_THREAD_OS2 1 + +/* Enable various timer systems */ +#define SDL_TIMER_OS2 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_OS2FS 1 + +/* Enable OpenGL support */ +/* Nothing here yet for OS/2... :( */ + +/* Enable assembly routines where available */ +#define SDL_ASSEMBLY_ROUTINES 1 + +#endif /* _SDL_config_os2_h */ diff --git a/include/SDL_config_symbian.h b/include/SDL_config_symbian.h new file mode 100644 index 0000000..53527b2 --- /dev/null +++ b/include/SDL_config_symbian.h @@ -0,0 +1,146 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/* + +Symbian version Markus Mertama + +*/ + + +#ifndef _SDL_CONFIG_SYMBIAN_H +#define _SDL_CONFIG_SYMBIAN_H + +#include "SDL_platform.h" + +/* This is the minimal configuration that can be used to build SDL */ + + +#include +#include + + +#ifdef __GCCE__ +#define SYMBIAN32_GCCE +#endif + +#ifndef _SIZE_T_DEFINED +typedef unsigned int size_t; +#endif + +#ifndef _INTPTR_T_DECLARED +typedef unsigned int uintptr_t; +#endif + +#ifndef _INT8_T_DECLARED +typedef signed char int8_t; +#endif + +#ifndef _UINT8_T_DECLARED +typedef unsigned char uint8_t; +#endif + +#ifndef _INT16_T_DECLARED +typedef signed short int16_t; +#endif + +#ifndef _UINT16_T_DECLARED +typedef unsigned short uint16_t; +#endif + +#ifndef _INT32_T_DECLARED +typedef signed int int32_t; +#endif + +#ifndef _UINT32_T_DECLARED +typedef unsigned int uint32_t; +#endif + +#ifndef _INT64_T_DECLARED +typedef signed long long int64_t; +#endif + +#ifndef _UINT64_T_DECLARED +typedef unsigned long long uint64_t; +#endif + +#define SDL_AUDIO_DRIVER_EPOCAUDIO 1 + + +/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ +#define SDL_CDROM_DISABLED 1 + +/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ +#define SDL_JOYSTICK_DISABLED 1 + +/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ +#define SDL_LOADSO_DISABLED 1 + +#define SDL_THREAD_SYMBIAN 1 + +#define SDL_VIDEO_DRIVER_EPOC 1 + +#define SDL_VIDEO_OPENGL 0 + +#define SDL_HAS_64BIT_TYPE 1 + +#define HAVE_LIBC 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 + +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +/*#define HAVE_ALLOCA 1*/ +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE__STRUPR 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_ITOA 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +/*#define HAVE__STRICMP 1*/ +#define HAVE__STRNICMP 1 +#define HAVE_SSCANF 1 +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 + + + +#endif /* _SDL_CONFIG_SYMBIAN_H */ diff --git a/include/SDL_config_win32.h b/include/SDL_config_win32.h new file mode 100644 index 0000000..6d019a8 --- /dev/null +++ b/include/SDL_config_win32.h @@ -0,0 +1,183 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_win32_h +#define _SDL_config_win32_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +#if defined(__GNUC__) || defined(__DMC__) +#define HAVE_STDINT_H 1 +#elif defined(_MSC_VER) +typedef signed __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +#else +typedef unsigned int uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif +/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ +#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) +#define DWORD_PTR DWORD +#endif +#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) +#define LONG_PTR LONG +#endif +#else /* !__GNUC__ && !_MSC_VER */ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef unsigned int size_t; +#endif +typedef unsigned int uintptr_t; +#endif /* __GNUC__ || _MSC_VER */ +#define SDL_HAS_64BIT_TYPE 1 + +/* Enabled for SDL 1.2 (binary compatibility) */ +#define HAVE_LIBC 1 +#ifdef HAVE_LIBC +/* Useful headers */ +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#ifndef _WIN32_WCE +#define HAVE_SIGNAL_H 1 +#endif + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE__STRREV 1 +#define HAVE__STRUPR 1 +#define HAVE__STRLWR 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_ITOA 1 +#define HAVE__LTOA 1 +#define HAVE__ULTOA 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE__STRICMP 1 +#define HAVE__STRNICMP 1 +#define HAVE_SSCANF 1 +#else +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 +#endif + +/* Enable various audio drivers */ +#ifndef _WIN32_WCE +#define SDL_AUDIO_DRIVER_DSOUND 1 +#endif +#define SDL_AUDIO_DRIVER_WAVEOUT 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various cdrom drivers */ +#ifdef _WIN32_WCE +#define SDL_CDROM_DISABLED 1 +#else +#define SDL_CDROM_WIN32 1 +#endif + +/* Enable various input drivers */ +#ifdef _WIN32_WCE +#define SDL_JOYSTICK_DISABLED 1 +#else +#define SDL_JOYSTICK_WINMM 1 +#endif + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_WIN32 1 + +/* Enable various threading systems */ +#define SDL_THREAD_WIN32 1 + +/* Enable various timer systems */ +#ifdef _WIN32_WCE +#define SDL_TIMER_WINCE 1 +#else +#define SDL_TIMER_WIN32 1 +#endif + +/* Enable various video drivers */ +#ifdef _WIN32_WCE +#define SDL_VIDEO_DRIVER_GAPI 1 +#endif +#ifndef _WIN32_WCE +#define SDL_VIDEO_DRIVER_DDRAW 1 +#endif +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_WINDIB 1 + +/* Enable OpenGL support */ +#ifndef _WIN32_WCE +#define SDL_VIDEO_OPENGL 1 +#define SDL_VIDEO_OPENGL_WGL 1 +#endif + +/* Disable screensaver */ +#define SDL_VIDEO_DISABLE_SCREENSAVER 1 + +/* Enable assembly routines (Win64 doesn't have inline asm) */ +#ifndef _WIN64 +#define SDL_ASSEMBLY_ROUTINES 1 +#endif + +#endif /* _SDL_config_win32_h */ diff --git a/include/SDL_copying.h b/include/SDL_copying.h new file mode 100644 index 0000000..1bd6b84 --- /dev/null +++ b/include/SDL_copying.h @@ -0,0 +1,22 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + diff --git a/include/SDL_cpuinfo.h b/include/SDL_cpuinfo.h new file mode 100644 index 0000000..f4be8e0 --- /dev/null +++ b/include/SDL_cpuinfo.h @@ -0,0 +1,69 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_cpuinfo.h + * CPU feature detection for SDL + */ + +#ifndef _SDL_cpuinfo_h +#define _SDL_cpuinfo_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** This function returns true if the CPU has the RDTSC instruction */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void); + +/** This function returns true if the CPU has MMX features */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); + +/** This function returns true if the CPU has MMX Ext. features */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void); + +/** This function returns true if the CPU has 3DNow features */ +extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void); + +/** This function returns true if the CPU has 3DNow! Ext. features */ +extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void); + +/** This function returns true if the CPU has SSE features */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void); + +/** This function returns true if the CPU has SSE2 features */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); + +/** This function returns true if the CPU has AltiVec features */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_cpuinfo_h */ diff --git a/include/SDL_endian.h b/include/SDL_endian.h new file mode 100644 index 0000000..f7a2e2f --- /dev/null +++ b/include/SDL_endian.h @@ -0,0 +1,209 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_endian.h + * Functions for reading and writing endian-specific values + */ + +#ifndef _SDL_endian_h +#define _SDL_endian_h + +#include "SDL_stdinc.h" + +/** @name SDL_ENDIANs + * The two types of endianness + */ +/*@{*/ +#define SDL_LIL_ENDIAN 1234 +#define SDL_BIG_ENDIAN 4321 +/*@}*/ + +#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ +#if defined(__hppa__) || \ + defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ + (defined(__MIPS__) && defined(__MISPEB__)) || \ + defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \ + defined(__sparc__) +#define SDL_BYTEORDER SDL_BIG_ENDIAN +#else +#define SDL_BYTEORDER SDL_LIL_ENDIAN +#endif +#endif /* !SDL_BYTEORDER */ + + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @name SDL_Swap Functions + * Use inline functions for compilers that support them, and static + * functions for those that do not. Because these functions become + * static for compilers that do not support inline functions, this + * header should only be included in files that actually use them. + */ +/*@{*/ +#if defined(__GNUC__) && defined(__i386__) && \ + !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) +static __inline__ Uint16 SDL_Swap16(Uint16 x) +{ + __asm__("xchgb %b0,%h0" : "=q" (x) : "0" (x)); + return x; +} +#elif defined(__GNUC__) && defined(__x86_64__) +static __inline__ Uint16 SDL_Swap16(Uint16 x) +{ + __asm__("xchgb %b0,%h0" : "=Q" (x) : "0" (x)); + return x; +} +#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) +static __inline__ Uint16 SDL_Swap16(Uint16 x) +{ + Uint16 result; + + __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x)); + return result; +} +#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) +static __inline__ Uint16 SDL_Swap16(Uint16 x) +{ + __asm__("rorw #8,%0" : "=d" (x) : "0" (x) : "cc"); + return x; +} +#else +static __inline__ Uint16 SDL_Swap16(Uint16 x) { + return((x<<8)|(x>>8)); +} +#endif + +#if defined(__GNUC__) && defined(__i386__) && \ + !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) +static __inline__ Uint32 SDL_Swap32(Uint32 x) +{ + __asm__("bswap %0" : "=r" (x) : "0" (x)); + return x; +} +#elif defined(__GNUC__) && defined(__x86_64__) +static __inline__ Uint32 SDL_Swap32(Uint32 x) +{ + __asm__("bswapl %0" : "=r" (x) : "0" (x)); + return x; +} +#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) +static __inline__ Uint32 SDL_Swap32(Uint32 x) +{ + Uint32 result; + + __asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x)); + __asm__("rlwimi %0,%2,8,8,15" : "=&r" (result) : "0" (result), "r" (x)); + __asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x)); + return result; +} +#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) +static __inline__ Uint32 SDL_Swap32(Uint32 x) +{ + __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) : "0" (x) : "cc"); + return x; +} +#else +static __inline__ Uint32 SDL_Swap32(Uint32 x) { + return((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24)); +} +#endif + +#ifdef SDL_HAS_64BIT_TYPE +#if defined(__GNUC__) && defined(__i386__) && \ + !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) +static __inline__ Uint64 SDL_Swap64(Uint64 x) +{ + union { + struct { Uint32 a,b; } s; + Uint64 u; + } v; + v.u = x; + __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1" + : "=r" (v.s.a), "=r" (v.s.b) + : "0" (v.s.a), "1" (v.s.b)); + return v.u; +} +#elif defined(__GNUC__) && defined(__x86_64__) +static __inline__ Uint64 SDL_Swap64(Uint64 x) +{ + __asm__("bswapq %0" : "=r" (x) : "0" (x)); + return x; +} +#else +static __inline__ Uint64 SDL_Swap64(Uint64 x) +{ + Uint32 hi, lo; + + /* Separate into high and low 32-bit values and swap them */ + lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF); + x >>= 32; + hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF); + x = SDL_Swap32(lo); + x <<= 32; + x |= SDL_Swap32(hi); + return(x); +} +#endif +#else +/* This is mainly to keep compilers from complaining in SDL code. + * If there is no real 64-bit datatype, then compilers will complain about + * the fake 64-bit datatype that SDL provides when it compiles user code. + */ +#define SDL_Swap64(X) (X) +#endif /* SDL_HAS_64BIT_TYPE */ +/*@}*/ + +/** + * @name SDL_SwapLE and SDL_SwapBE Functions + * Byteswap item from the specified endianness to the native endianness + */ +/*@{*/ +#if SDL_BYTEORDER == SDL_LIL_ENDIAN +#define SDL_SwapLE16(X) (X) +#define SDL_SwapLE32(X) (X) +#define SDL_SwapLE64(X) (X) +#define SDL_SwapBE16(X) SDL_Swap16(X) +#define SDL_SwapBE32(X) SDL_Swap32(X) +#define SDL_SwapBE64(X) SDL_Swap64(X) +#else +#define SDL_SwapLE16(X) SDL_Swap16(X) +#define SDL_SwapLE32(X) SDL_Swap32(X) +#define SDL_SwapLE64(X) SDL_Swap64(X) +#define SDL_SwapBE16(X) (X) +#define SDL_SwapBE32(X) (X) +#define SDL_SwapBE64(X) (X) +#endif +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_endian_h */ diff --git a/include/SDL_error.h b/include/SDL_error.h new file mode 100644 index 0000000..b103703 --- /dev/null +++ b/include/SDL_error.h @@ -0,0 +1,72 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_error.h + * Simple error message routines for SDL + */ + +#ifndef _SDL_error_h +#define _SDL_error_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @name Public functions + */ +/*@{*/ +extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...); +extern DECLSPEC char * SDLCALL SDL_GetError(void); +extern DECLSPEC void SDLCALL SDL_ClearError(void); +/*@}*/ + +/** + * @name Private functions + * @internal Private error message function - used internally + */ +/*@{*/ +#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) +#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) +typedef enum { + SDL_ENOMEM, + SDL_EFREAD, + SDL_EFWRITE, + SDL_EFSEEK, + SDL_UNSUPPORTED, + SDL_LASTERROR +} SDL_errorcode; +extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code); +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_error_h */ diff --git a/include/SDL_events.h b/include/SDL_events.h new file mode 100644 index 0000000..c94a30c --- /dev/null +++ b/include/SDL_events.h @@ -0,0 +1,356 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_events.h + * Include file for SDL event handling + */ + +#ifndef _SDL_events_h +#define _SDL_events_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_active.h" +#include "SDL_keyboard.h" +#include "SDL_mouse.h" +#include "SDL_joystick.h" +#include "SDL_quit.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @name General keyboard/mouse state definitions */ +/*@{*/ +#define SDL_RELEASED 0 +#define SDL_PRESSED 1 +/*@}*/ + +/** Event enumerations */ +typedef enum { + SDL_NOEVENT = 0, /**< Unused (do not remove) */ + SDL_ACTIVEEVENT, /**< Application loses/gains visibility */ + SDL_KEYDOWN, /**< Keys pressed */ + SDL_KEYUP, /**< Keys released */ + SDL_MOUSEMOTION, /**< Mouse moved */ + SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */ + SDL_MOUSEBUTTONUP, /**< Mouse button released */ + SDL_JOYAXISMOTION, /**< Joystick axis motion */ + SDL_JOYBALLMOTION, /**< Joystick trackball motion */ + SDL_JOYHATMOTION, /**< Joystick hat position change */ + SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ + SDL_JOYBUTTONUP, /**< Joystick button released */ + SDL_QUIT, /**< User-requested quit */ + SDL_SYSWMEVENT, /**< System specific event */ + SDL_EVENT_RESERVEDA, /**< Reserved for future use.. */ + SDL_EVENT_RESERVEDB, /**< Reserved for future use.. */ + SDL_VIDEORESIZE, /**< User resized video mode */ + SDL_VIDEOEXPOSE, /**< Screen needs to be redrawn */ + SDL_EVENT_RESERVED2, /**< Reserved for future use.. */ + SDL_EVENT_RESERVED3, /**< Reserved for future use.. */ + SDL_EVENT_RESERVED4, /**< Reserved for future use.. */ + SDL_EVENT_RESERVED5, /**< Reserved for future use.. */ + SDL_EVENT_RESERVED6, /**< Reserved for future use.. */ + SDL_EVENT_RESERVED7, /**< Reserved for future use.. */ + /** Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */ + SDL_USEREVENT = 24, + /** This last event is only for bounding internal arrays + * It is the number of bits in the event mask datatype -- Uint32 + */ + SDL_NUMEVENTS = 32 +} SDL_EventType; + +/** @name Predefined event masks */ +/*@{*/ +#define SDL_EVENTMASK(X) (1<<(X)) +typedef enum { + SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT), + SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN), + SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP), + SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN)| + SDL_EVENTMASK(SDL_KEYUP), + SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION), + SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN), + SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP), + SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION)| + SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)| + SDL_EVENTMASK(SDL_MOUSEBUTTONUP), + SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION), + SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION), + SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION), + SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN), + SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP), + SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION)| + SDL_EVENTMASK(SDL_JOYBALLMOTION)| + SDL_EVENTMASK(SDL_JOYHATMOTION)| + SDL_EVENTMASK(SDL_JOYBUTTONDOWN)| + SDL_EVENTMASK(SDL_JOYBUTTONUP), + SDL_VIDEORESIZEMASK = SDL_EVENTMASK(SDL_VIDEORESIZE), + SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE), + SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT), + SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT) +} SDL_EventMask ; +#define SDL_ALLEVENTS 0xFFFFFFFF +/*@}*/ + +/** Application visibility event structure */ +typedef struct SDL_ActiveEvent { + Uint8 type; /**< SDL_ACTIVEEVENT */ + Uint8 gain; /**< Whether given states were gained or lost (1/0) */ + Uint8 state; /**< A mask of the focus states */ +} SDL_ActiveEvent; + +/** Keyboard event structure */ +typedef struct SDL_KeyboardEvent { + Uint8 type; /**< SDL_KEYDOWN or SDL_KEYUP */ + Uint8 which; /**< The keyboard device index */ + Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ + SDL_keysym keysym; +} SDL_KeyboardEvent; + +/** Mouse motion event structure */ +typedef struct SDL_MouseMotionEvent { + Uint8 type; /**< SDL_MOUSEMOTION */ + Uint8 which; /**< The mouse device index */ + Uint8 state; /**< The current button state */ + Uint16 x, y; /**< The X/Y coordinates of the mouse */ + Sint16 xrel; /**< The relative motion in the X direction */ + Sint16 yrel; /**< The relative motion in the Y direction */ +} SDL_MouseMotionEvent; + +/** Mouse button event structure */ +typedef struct SDL_MouseButtonEvent { + Uint8 type; /**< SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */ + Uint8 which; /**< The mouse device index */ + Uint8 button; /**< The mouse button index */ + Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ + Uint16 x, y; /**< The X/Y coordinates of the mouse at press time */ +} SDL_MouseButtonEvent; + +/** Joystick axis motion event structure */ +typedef struct SDL_JoyAxisEvent { + Uint8 type; /**< SDL_JOYAXISMOTION */ + Uint8 which; /**< The joystick device index */ + Uint8 axis; /**< The joystick axis index */ + Sint16 value; /**< The axis value (range: -32768 to 32767) */ +} SDL_JoyAxisEvent; + +/** Joystick trackball motion event structure */ +typedef struct SDL_JoyBallEvent { + Uint8 type; /**< SDL_JOYBALLMOTION */ + Uint8 which; /**< The joystick device index */ + Uint8 ball; /**< The joystick trackball index */ + Sint16 xrel; /**< The relative motion in the X direction */ + Sint16 yrel; /**< The relative motion in the Y direction */ +} SDL_JoyBallEvent; + +/** Joystick hat position change event structure */ +typedef struct SDL_JoyHatEvent { + Uint8 type; /**< SDL_JOYHATMOTION */ + Uint8 which; /**< The joystick device index */ + Uint8 hat; /**< The joystick hat index */ + Uint8 value; /**< The hat position value: + * SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP + * SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT + * SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN + * Note that zero means the POV is centered. + */ +} SDL_JoyHatEvent; + +/** Joystick button event structure */ +typedef struct SDL_JoyButtonEvent { + Uint8 type; /**< SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */ + Uint8 which; /**< The joystick device index */ + Uint8 button; /**< The joystick button index */ + Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ +} SDL_JoyButtonEvent; + +/** The "window resized" event + * When you get this event, you are responsible for setting a new video + * mode with the new width and height. + */ +typedef struct SDL_ResizeEvent { + Uint8 type; /**< SDL_VIDEORESIZE */ + int w; /**< New width */ + int h; /**< New height */ +} SDL_ResizeEvent; + +/** The "screen redraw" event */ +typedef struct SDL_ExposeEvent { + Uint8 type; /**< SDL_VIDEOEXPOSE */ +} SDL_ExposeEvent; + +/** The "quit requested" event */ +typedef struct SDL_QuitEvent { + Uint8 type; /**< SDL_QUIT */ +} SDL_QuitEvent; + +/** A user-defined event type */ +typedef struct SDL_UserEvent { + Uint8 type; /**< SDL_USEREVENT through SDL_NUMEVENTS-1 */ + int code; /**< User defined event code */ + void *data1; /**< User defined data pointer */ + void *data2; /**< User defined data pointer */ +} SDL_UserEvent; + +/** If you want to use this event, you should include SDL_syswm.h */ +struct SDL_SysWMmsg; +typedef struct SDL_SysWMmsg SDL_SysWMmsg; +typedef struct SDL_SysWMEvent { + Uint8 type; + SDL_SysWMmsg *msg; +} SDL_SysWMEvent; + +/** General event structure */ +typedef union SDL_Event { + Uint8 type; + SDL_ActiveEvent active; + SDL_KeyboardEvent key; + SDL_MouseMotionEvent motion; + SDL_MouseButtonEvent button; + SDL_JoyAxisEvent jaxis; + SDL_JoyBallEvent jball; + SDL_JoyHatEvent jhat; + SDL_JoyButtonEvent jbutton; + SDL_ResizeEvent resize; + SDL_ExposeEvent expose; + SDL_QuitEvent quit; + SDL_UserEvent user; + SDL_SysWMEvent syswm; +} SDL_Event; + + +/* Function prototypes */ + +/** Pumps the event loop, gathering events from the input devices. + * This function updates the event queue and internal input device state. + * This should only be run in the thread that sets the video mode. + */ +extern DECLSPEC void SDLCALL SDL_PumpEvents(void); + +typedef enum { + SDL_ADDEVENT, + SDL_PEEKEVENT, + SDL_GETEVENT +} SDL_eventaction; + +/** + * Checks the event queue for messages and optionally returns them. + * + * If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to + * the back of the event queue. + * If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front + * of the event queue, matching 'mask', will be returned and will not + * be removed from the queue. + * If 'action' is SDL_GETEVENT, up to 'numevents' events at the front + * of the event queue, matching 'mask', will be returned and will be + * removed from the queue. + * + * @return + * This function returns the number of events actually stored, or -1 + * if there was an error. + * + * This function is thread-safe. + */ +extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents, + SDL_eventaction action, Uint32 mask); + +/** Polls for currently pending events, and returns 1 if there are any pending + * events, or 0 if there are none available. If 'event' is not NULL, the next + * event is removed from the queue and stored in that area. + */ +extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event *event); + +/** Waits indefinitely for the next available event, returning 1, or 0 if there + * was an error while waiting for events. If 'event' is not NULL, the next + * event is removed from the queue and stored in that area. + */ +extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event *event); + +/** Add an event to the event queue. + * This function returns 0 on success, or -1 if the event queue was full + * or there was some other error. + */ +extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event); + +/** @name Event Filtering */ +/*@{*/ +typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event); +/** + * This function sets up a filter to process all events before they + * change internal state and are posted to the internal event queue. + * + * The filter is protypted as: + * @code typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event); @endcode + * + * If the filter returns 1, then the event will be added to the internal queue. + * If it returns 0, then the event will be dropped from the queue, but the + * internal state will still be updated. This allows selective filtering of + * dynamically arriving events. + * + * @warning Be very careful of what you do in the event filter function, as + * it may run in a different thread! + * + * There is one caveat when dealing with the SDL_QUITEVENT event type. The + * event filter is only called when the window manager desires to close the + * application window. If the event filter returns 1, then the window will + * be closed, otherwise the window will remain open if possible. + * If the quit event is generated by an interrupt signal, it will bypass the + * internal queue and be delivered to the application at the next event poll. + */ +extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter); + +/** + * Return the current event filter - can be used to "chain" filters. + * If there is no event filter set, this function returns NULL. + */ +extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter(void); +/*@}*/ + +/** @name Event State */ +/*@{*/ +#define SDL_QUERY -1 +#define SDL_IGNORE 0 +#define SDL_DISABLE 0 +#define SDL_ENABLE 1 +/*@}*/ + +/** +* This function allows you to set the state of processing certain events. +* If 'state' is set to SDL_IGNORE, that event will be automatically dropped +* from the event queue and will not event be filtered. +* If 'state' is set to SDL_ENABLE, that event will be processed normally. +* If 'state' is set to SDL_QUERY, SDL_EventState() will return the +* current processing state of the specified event. +*/ +extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_events_h */ diff --git a/include/SDL_getenv.h b/include/SDL_getenv.h new file mode 100644 index 0000000..253ad88 --- /dev/null +++ b/include/SDL_getenv.h @@ -0,0 +1,28 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_getenv.h + * @deprecated Use SDL_stdinc.h instead + */ + +/* DEPRECATED */ +#include "SDL_stdinc.h" diff --git a/include/SDL_joystick.h b/include/SDL_joystick.h new file mode 100644 index 0000000..d5135c3 --- /dev/null +++ b/include/SDL_joystick.h @@ -0,0 +1,187 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_joystick.h + * Include file for SDL joystick event handling + */ + +#ifndef _SDL_joystick_h +#define _SDL_joystick_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @file SDL_joystick.h + * @note In order to use these functions, SDL_Init() must have been called + * with the SDL_INIT_JOYSTICK flag. This causes SDL to scan the system + * for joysticks, and load appropriate drivers. + */ + +/** The joystick structure used to identify an SDL joystick */ +struct _SDL_Joystick; +typedef struct _SDL_Joystick SDL_Joystick; + +/* Function prototypes */ +/** + * Count the number of joysticks attached to the system + */ +extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); + +/** + * Get the implementation dependent name of a joystick. + * + * This can be called before any joysticks are opened. + * If no name can be found, this function returns NULL. + */ +extern DECLSPEC const char * SDLCALL SDL_JoystickName(int device_index); + +/** + * Open a joystick for use. + * + * @param[in] device_index + * The index passed as an argument refers to + * the N'th joystick on the system. This index is the value which will + * identify this joystick in future joystick events. + * + * @return This function returns a joystick identifier, or NULL if an error occurred. + */ +extern DECLSPEC SDL_Joystick * SDLCALL SDL_JoystickOpen(int device_index); + +/** + * Returns 1 if the joystick has been opened, or 0 if it has not. + */ +extern DECLSPEC int SDLCALL SDL_JoystickOpened(int device_index); + +/** + * Get the device index of an opened joystick. + */ +extern DECLSPEC int SDLCALL SDL_JoystickIndex(SDL_Joystick *joystick); + +/** + * Get the number of general axis controls on a joystick + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick); + +/** + * Get the number of trackballs on a joystick + * + * Joystick trackballs have only relative motion events associated + * with them and their state cannot be polled. + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick); + +/** + * Get the number of POV hats on a joystick + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick); + +/** + * Get the number of buttons on a joystick + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick); + +/** + * Update the current state of the open joysticks. + * + * This is called automatically by the event loop if any joystick + * events are enabled. + */ +extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); + +/** + * Enable/disable joystick event polling. + * + * If joystick events are disabled, you must call SDL_JoystickUpdate() + * yourself and check the state of the joystick when you want joystick + * information. + * + * @param[in] state The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE. + */ +extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); + +/** + * Get the current state of an axis control on a joystick + * + * @param[in] axis The axis indices start at index 0. + * + * @return The state is a value ranging from -32768 to 32767. + */ +extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis); + +/** + * @name Hat Positions + * The return value of SDL_JoystickGetHat() is one of the following positions: + */ +/*@{*/ +#define SDL_HAT_CENTERED 0x00 +#define SDL_HAT_UP 0x01 +#define SDL_HAT_RIGHT 0x02 +#define SDL_HAT_DOWN 0x04 +#define SDL_HAT_LEFT 0x08 +#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP) +#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN) +#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) +#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) +/*@}*/ + +/** + * Get the current state of a POV hat on a joystick + * + * @param[in] hat The hat indices start at index 0. + */ +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, int hat); + +/** + * Get the ball axis change since the last poll + * + * @param[in] ball The ball indices start at index 0. + * + * @return This returns 0, or -1 if you passed it invalid parameters. + */ +extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy); + +/** + * Get the current state of a button on a joystick + * + * @param[in] button The button indices start at index 0. + */ +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, int button); + +/** + * Close a joystick previously opened with SDL_JoystickOpen() + */ +extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_joystick_h */ diff --git a/include/SDL_keyboard.h b/include/SDL_keyboard.h new file mode 100644 index 0000000..7b59d24 --- /dev/null +++ b/include/SDL_keyboard.h @@ -0,0 +1,135 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_keyboard.h + * Include file for SDL keyboard event handling + */ + +#ifndef _SDL_keyboard_h +#define _SDL_keyboard_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_keysym.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** Keysym structure + * + * - The scancode is hardware dependent, and should not be used by general + * applications. If no hardware scancode is available, it will be 0. + * + * - The 'unicode' translated character is only available when character + * translation is enabled by the SDL_EnableUNICODE() API. If non-zero, + * this is a UNICODE character corresponding to the keypress. If the + * high 9 bits of the character are 0, then this maps to the equivalent + * ASCII character: + * @code + * char ch; + * if ( (keysym.unicode & 0xFF80) == 0 ) { + * ch = keysym.unicode & 0x7F; + * } else { + * An international character.. + * } + * @endcode + */ +typedef struct SDL_keysym { + Uint8 scancode; /**< hardware specific scancode */ + SDLKey sym; /**< SDL virtual keysym */ + SDLMod mod; /**< current key modifiers */ + Uint16 unicode; /**< translated character */ +} SDL_keysym; + +/** This is the mask which refers to all hotkey bindings */ +#define SDL_ALL_HOTKEYS 0xFFFFFFFF + +/* Function prototypes */ +/** + * Enable/Disable UNICODE translation of keyboard input. + * + * This translation has some overhead, so translation defaults off. + * + * @param[in] enable + * If 'enable' is 1, translation is enabled. + * If 'enable' is 0, translation is disabled. + * If 'enable' is -1, the translation state is not changed. + * + * @return It returns the previous state of keyboard translation. + */ +extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable); + +#define SDL_DEFAULT_REPEAT_DELAY 500 +#define SDL_DEFAULT_REPEAT_INTERVAL 30 +/** + * Enable/Disable keyboard repeat. Keyboard repeat defaults to off. + * + * @param[in] delay + * 'delay' is the initial delay in ms between the time when a key is + * pressed, and keyboard repeat begins. + * + * @param[in] interval + * 'interval' is the time in ms between keyboard repeat events. + * + * If 'delay' is set to 0, keyboard repeat is disabled. + */ +extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval); +extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval); + +/** + * Get a snapshot of the current state of the keyboard. + * Returns an array of keystates, indexed by the SDLK_* syms. + * Usage: + * @code + * Uint8 *keystate = SDL_GetKeyState(NULL); + * if ( keystate[SDLK_RETURN] ) //... \ is pressed. + * @endcode + */ +extern DECLSPEC Uint8 * SDLCALL SDL_GetKeyState(int *numkeys); + +/** + * Get the current key modifier state + */ +extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void); + +/** + * Set the current key modifier state. + * This does not change the keyboard state, only the key modifier flags. + */ +extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate); + +/** + * Get the name of an SDL virtual keysym + */ +extern DECLSPEC char * SDLCALL SDL_GetKeyName(SDLKey key); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_keyboard_h */ diff --git a/include/SDL_keysym.h b/include/SDL_keysym.h new file mode 100644 index 0000000..9010128 --- /dev/null +++ b/include/SDL_keysym.h @@ -0,0 +1,326 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_keysym_h +#define _SDL_keysym_h + +/** What we really want is a mapping of every raw key on the keyboard. + * To support international keyboards, we use the range 0xA1 - 0xFF + * as international virtual keycodes. We'll follow in the footsteps of X11... + * @brief The names of the keys + */ +typedef enum { + /** @name ASCII mapped keysyms + * The keyboard syms have been cleverly chosen to map to ASCII + */ + /*@{*/ + SDLK_UNKNOWN = 0, + SDLK_FIRST = 0, + SDLK_BACKSPACE = 8, + SDLK_TAB = 9, + SDLK_CLEAR = 12, + SDLK_RETURN = 13, + SDLK_PAUSE = 19, + SDLK_ESCAPE = 27, + SDLK_SPACE = 32, + SDLK_EXCLAIM = 33, + SDLK_QUOTEDBL = 34, + SDLK_HASH = 35, + SDLK_DOLLAR = 36, + SDLK_AMPERSAND = 38, + SDLK_QUOTE = 39, + SDLK_LEFTPAREN = 40, + SDLK_RIGHTPAREN = 41, + SDLK_ASTERISK = 42, + SDLK_PLUS = 43, + SDLK_COMMA = 44, + SDLK_MINUS = 45, + SDLK_PERIOD = 46, + SDLK_SLASH = 47, + SDLK_0 = 48, + SDLK_1 = 49, + SDLK_2 = 50, + SDLK_3 = 51, + SDLK_4 = 52, + SDLK_5 = 53, + SDLK_6 = 54, + SDLK_7 = 55, + SDLK_8 = 56, + SDLK_9 = 57, + SDLK_COLON = 58, + SDLK_SEMICOLON = 59, + SDLK_LESS = 60, + SDLK_EQUALS = 61, + SDLK_GREATER = 62, + SDLK_QUESTION = 63, + SDLK_AT = 64, + /* + Skip uppercase letters + */ + SDLK_LEFTBRACKET = 91, + SDLK_BACKSLASH = 92, + SDLK_RIGHTBRACKET = 93, + SDLK_CARET = 94, + SDLK_UNDERSCORE = 95, + SDLK_BACKQUOTE = 96, + SDLK_a = 97, + SDLK_b = 98, + SDLK_c = 99, + SDLK_d = 100, + SDLK_e = 101, + SDLK_f = 102, + SDLK_g = 103, + SDLK_h = 104, + SDLK_i = 105, + SDLK_j = 106, + SDLK_k = 107, + SDLK_l = 108, + SDLK_m = 109, + SDLK_n = 110, + SDLK_o = 111, + SDLK_p = 112, + SDLK_q = 113, + SDLK_r = 114, + SDLK_s = 115, + SDLK_t = 116, + SDLK_u = 117, + SDLK_v = 118, + SDLK_w = 119, + SDLK_x = 120, + SDLK_y = 121, + SDLK_z = 122, + SDLK_DELETE = 127, + /* End of ASCII mapped keysyms */ + /*@}*/ + + /** @name International keyboard syms */ + /*@{*/ + SDLK_WORLD_0 = 160, /* 0xA0 */ + SDLK_WORLD_1 = 161, + SDLK_WORLD_2 = 162, + SDLK_WORLD_3 = 163, + SDLK_WORLD_4 = 164, + SDLK_WORLD_5 = 165, + SDLK_WORLD_6 = 166, + SDLK_WORLD_7 = 167, + SDLK_WORLD_8 = 168, + SDLK_WORLD_9 = 169, + SDLK_WORLD_10 = 170, + SDLK_WORLD_11 = 171, + SDLK_WORLD_12 = 172, + SDLK_WORLD_13 = 173, + SDLK_WORLD_14 = 174, + SDLK_WORLD_15 = 175, + SDLK_WORLD_16 = 176, + SDLK_WORLD_17 = 177, + SDLK_WORLD_18 = 178, + SDLK_WORLD_19 = 179, + SDLK_WORLD_20 = 180, + SDLK_WORLD_21 = 181, + SDLK_WORLD_22 = 182, + SDLK_WORLD_23 = 183, + SDLK_WORLD_24 = 184, + SDLK_WORLD_25 = 185, + SDLK_WORLD_26 = 186, + SDLK_WORLD_27 = 187, + SDLK_WORLD_28 = 188, + SDLK_WORLD_29 = 189, + SDLK_WORLD_30 = 190, + SDLK_WORLD_31 = 191, + SDLK_WORLD_32 = 192, + SDLK_WORLD_33 = 193, + SDLK_WORLD_34 = 194, + SDLK_WORLD_35 = 195, + SDLK_WORLD_36 = 196, + SDLK_WORLD_37 = 197, + SDLK_WORLD_38 = 198, + SDLK_WORLD_39 = 199, + SDLK_WORLD_40 = 200, + SDLK_WORLD_41 = 201, + SDLK_WORLD_42 = 202, + SDLK_WORLD_43 = 203, + SDLK_WORLD_44 = 204, + SDLK_WORLD_45 = 205, + SDLK_WORLD_46 = 206, + SDLK_WORLD_47 = 207, + SDLK_WORLD_48 = 208, + SDLK_WORLD_49 = 209, + SDLK_WORLD_50 = 210, + SDLK_WORLD_51 = 211, + SDLK_WORLD_52 = 212, + SDLK_WORLD_53 = 213, + SDLK_WORLD_54 = 214, + SDLK_WORLD_55 = 215, + SDLK_WORLD_56 = 216, + SDLK_WORLD_57 = 217, + SDLK_WORLD_58 = 218, + SDLK_WORLD_59 = 219, + SDLK_WORLD_60 = 220, + SDLK_WORLD_61 = 221, + SDLK_WORLD_62 = 222, + SDLK_WORLD_63 = 223, + SDLK_WORLD_64 = 224, + SDLK_WORLD_65 = 225, + SDLK_WORLD_66 = 226, + SDLK_WORLD_67 = 227, + SDLK_WORLD_68 = 228, + SDLK_WORLD_69 = 229, + SDLK_WORLD_70 = 230, + SDLK_WORLD_71 = 231, + SDLK_WORLD_72 = 232, + SDLK_WORLD_73 = 233, + SDLK_WORLD_74 = 234, + SDLK_WORLD_75 = 235, + SDLK_WORLD_76 = 236, + SDLK_WORLD_77 = 237, + SDLK_WORLD_78 = 238, + SDLK_WORLD_79 = 239, + SDLK_WORLD_80 = 240, + SDLK_WORLD_81 = 241, + SDLK_WORLD_82 = 242, + SDLK_WORLD_83 = 243, + SDLK_WORLD_84 = 244, + SDLK_WORLD_85 = 245, + SDLK_WORLD_86 = 246, + SDLK_WORLD_87 = 247, + SDLK_WORLD_88 = 248, + SDLK_WORLD_89 = 249, + SDLK_WORLD_90 = 250, + SDLK_WORLD_91 = 251, + SDLK_WORLD_92 = 252, + SDLK_WORLD_93 = 253, + SDLK_WORLD_94 = 254, + SDLK_WORLD_95 = 255, /* 0xFF */ + /*@}*/ + + /** @name Numeric keypad */ + /*@{*/ + SDLK_KP0 = 256, + SDLK_KP1 = 257, + SDLK_KP2 = 258, + SDLK_KP3 = 259, + SDLK_KP4 = 260, + SDLK_KP5 = 261, + SDLK_KP6 = 262, + SDLK_KP7 = 263, + SDLK_KP8 = 264, + SDLK_KP9 = 265, + SDLK_KP_PERIOD = 266, + SDLK_KP_DIVIDE = 267, + SDLK_KP_MULTIPLY = 268, + SDLK_KP_MINUS = 269, + SDLK_KP_PLUS = 270, + SDLK_KP_ENTER = 271, + SDLK_KP_EQUALS = 272, + /*@}*/ + + /** @name Arrows + Home/End pad */ + /*@{*/ + SDLK_UP = 273, + SDLK_DOWN = 274, + SDLK_RIGHT = 275, + SDLK_LEFT = 276, + SDLK_INSERT = 277, + SDLK_HOME = 278, + SDLK_END = 279, + SDLK_PAGEUP = 280, + SDLK_PAGEDOWN = 281, + /*@}*/ + + /** @name Function keys */ + /*@{*/ + SDLK_F1 = 282, + SDLK_F2 = 283, + SDLK_F3 = 284, + SDLK_F4 = 285, + SDLK_F5 = 286, + SDLK_F6 = 287, + SDLK_F7 = 288, + SDLK_F8 = 289, + SDLK_F9 = 290, + SDLK_F10 = 291, + SDLK_F11 = 292, + SDLK_F12 = 293, + SDLK_F13 = 294, + SDLK_F14 = 295, + SDLK_F15 = 296, + /*@}*/ + + /** @name Key state modifier keys */ + /*@{*/ + SDLK_NUMLOCK = 300, + SDLK_CAPSLOCK = 301, + SDLK_SCROLLOCK = 302, + SDLK_RSHIFT = 303, + SDLK_LSHIFT = 304, + SDLK_RCTRL = 305, + SDLK_LCTRL = 306, + SDLK_RALT = 307, + SDLK_LALT = 308, + SDLK_RMETA = 309, + SDLK_LMETA = 310, + SDLK_LSUPER = 311, /**< Left "Windows" key */ + SDLK_RSUPER = 312, /**< Right "Windows" key */ + SDLK_MODE = 313, /**< "Alt Gr" key */ + SDLK_COMPOSE = 314, /**< Multi-key compose key */ + /*@}*/ + + /** @name Miscellaneous function keys */ + /*@{*/ + SDLK_HELP = 315, + SDLK_PRINT = 316, + SDLK_SYSREQ = 317, + SDLK_BREAK = 318, + SDLK_MENU = 319, + SDLK_POWER = 320, /**< Power Macintosh power key */ + SDLK_EURO = 321, /**< Some european keyboards */ + SDLK_UNDO = 322, /**< Atari keyboard has Undo */ + /*@}*/ + + /* Add any other keys here */ + + SDLK_LAST +} SDLKey; + +/** Enumeration of valid key mods (possibly OR'd together) */ +typedef enum { + KMOD_NONE = 0x0000, + KMOD_LSHIFT= 0x0001, + KMOD_RSHIFT= 0x0002, + KMOD_LCTRL = 0x0040, + KMOD_RCTRL = 0x0080, + KMOD_LALT = 0x0100, + KMOD_RALT = 0x0200, + KMOD_LMETA = 0x0400, + KMOD_RMETA = 0x0800, + KMOD_NUM = 0x1000, + KMOD_CAPS = 0x2000, + KMOD_MODE = 0x4000, + KMOD_RESERVED = 0x8000 +} SDLMod; + +#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) +#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) +#define KMOD_ALT (KMOD_LALT|KMOD_RALT) +#define KMOD_META (KMOD_LMETA|KMOD_RMETA) + +#endif /* _SDL_keysym_h */ diff --git a/include/SDL_loadso.h b/include/SDL_loadso.h new file mode 100644 index 0000000..45a17f9 --- /dev/null +++ b/include/SDL_loadso.h @@ -0,0 +1,78 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_loadso.h + * System dependent library loading routines + */ + +/** @file SDL_loadso.h + * Some things to keep in mind: + * - These functions only work on C function names. Other languages may + * have name mangling and intrinsic language support that varies from + * compiler to compiler. + * - Make sure you declare your function pointers with the same calling + * convention as the actual library function. Your code will crash + * mysteriously if you do not do this. + * - Avoid namespace collisions. If you load a symbol from the library, + * it is not defined whether or not it goes into the global symbol + * namespace for the application. If it does and it conflicts with + * symbols in your code or other shared libraries, you will not get + * the results you expect. :) + */ + + +#ifndef _SDL_loadso_h +#define _SDL_loadso_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This function dynamically loads a shared object and returns a pointer + * to the object handle (or NULL if there was an error). + * The 'sofile' parameter is a system dependent name of the object file. + */ +extern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile); + +/** + * Given an object handle, this function looks up the address of the + * named function in the shared object and returns it. This address + * is no longer valid after calling SDL_UnloadObject(). + */ +extern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name); + +/** Unload a shared object from memory */ +extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_loadso_h */ diff --git a/include/SDL_main.h b/include/SDL_main.h new file mode 100644 index 0000000..b7f6b2c --- /dev/null +++ b/include/SDL_main.h @@ -0,0 +1,106 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_main_h +#define _SDL_main_h + +#include "SDL_stdinc.h" + +/** @file SDL_main.h + * Redefine main() on Win32 and MacOS so that it is called by winmain.c + */ + +#if defined(__WIN32__) || \ + (defined(__MWERKS__) && !defined(__BEOS__)) || \ + defined(__MACOS__) || defined(__MACOSX__) || \ + defined(__SYMBIAN32__) || defined(QWS) + +#ifdef __cplusplus +#define C_LINKAGE "C" +#else +#define C_LINKAGE +#endif /* __cplusplus */ + +/** The application's main() function must be called with C linkage, + * and should be declared like this: + * @code + * #ifdef __cplusplus + * extern "C" + * #endif + * int main(int argc, char *argv[]) + * { + * } + * @endcode + */ +#define main SDL_main + +/** The prototype for the application's main() function */ +extern C_LINKAGE int SDL_main(int argc, char *argv[]); + + +/** @name From the SDL library code -- needed for registering the app on Win32 */ +/*@{*/ +#ifdef __WIN32__ + +#include "begin_code.h" +#ifdef __cplusplus +extern "C" { +#endif + +/** This should be called from your WinMain() function, if any */ +extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst); +/** This can also be called, but is no longer necessary */ +extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst); +/** This can also be called, but is no longer necessary (SDL_Quit calls it) */ +extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); +#ifdef __cplusplus +} +#endif +#include "close_code.h" +#endif +/*@}*/ + +/** @name From the SDL library code -- needed for registering QuickDraw on MacOS */ +/*@{*/ +#if defined(__MACOS__) + +#include "begin_code.h" +#ifdef __cplusplus +extern "C" { +#endif + +/** Forward declaration so we don't need to include QuickDraw.h */ +struct QDGlobals; + +/** This should be called from your main() function, if any */ +extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd); + +#ifdef __cplusplus +} +#endif +#include "close_code.h" +#endif +/*@}*/ + +#endif /* Need to redefine main()? */ + +#endif /* _SDL_main_h */ diff --git a/include/SDL_mouse.h b/include/SDL_mouse.h new file mode 100644 index 0000000..a573f04 --- /dev/null +++ b/include/SDL_mouse.h @@ -0,0 +1,143 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_mouse.h + * Include file for SDL mouse event handling + */ + +#ifndef _SDL_mouse_h +#define _SDL_mouse_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct WMcursor WMcursor; /**< Implementation dependent */ +typedef struct SDL_Cursor { + SDL_Rect area; /**< The area of the mouse cursor */ + Sint16 hot_x, hot_y; /**< The "tip" of the cursor */ + Uint8 *data; /**< B/W cursor data */ + Uint8 *mask; /**< B/W cursor mask */ + Uint8 *save[2]; /**< Place to save cursor area */ + WMcursor *wm_cursor; /**< Window-manager cursor */ +} SDL_Cursor; + +/* Function prototypes */ +/** + * Retrieve the current state of the mouse. + * The current button state is returned as a button bitmask, which can + * be tested using the SDL_BUTTON(X) macros, and x and y are set to the + * current mouse cursor position. You can pass NULL for either x or y. + */ +extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y); + +/** + * Retrieve the current state of the mouse. + * The current button state is returned as a button bitmask, which can + * be tested using the SDL_BUTTON(X) macros, and x and y are set to the + * mouse deltas since the last call to SDL_GetRelativeMouseState(). + */ +extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); + +/** + * Set the position of the mouse cursor (generates a mouse motion event) + */ +extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y); + +/** + * Create a cursor using the specified data and mask (in MSB format). + * The cursor width must be a multiple of 8 bits. + * + * The cursor is created in black and white according to the following: + * data mask resulting pixel on screen + * 0 1 White + * 1 1 Black + * 0 0 Transparent + * 1 0 Inverted color if possible, black if not. + * + * Cursors created with this function must be freed with SDL_FreeCursor(). + */ +extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor + (Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y); + +/** + * Set the currently active cursor to the specified one. + * If the cursor is currently visible, the change will be immediately + * represented on the display. + */ +extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor); + +/** + * Returns the currently active cursor. + */ +extern DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void); + +/** + * Deallocates a cursor created with SDL_CreateCursor(). + */ +extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor); + +/** + * Toggle whether or not the cursor is shown on the screen. + * The cursor start off displayed, but can be turned off. + * SDL_ShowCursor() returns 1 if the cursor was being displayed + * before the call, or 0 if it was not. You can query the current + * state by passing a 'toggle' value of -1. + */ +extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); + +/*@{*/ +/** Used as a mask when testing buttons in buttonstate + * Button 1: Left mouse button + * Button 2: Middle mouse button + * Button 3: Right mouse button + * Button 4: Mouse wheel up (may also be a real button) + * Button 5: Mouse wheel down (may also be a real button) + */ +#define SDL_BUTTON(X) (1 << ((X)-1)) +#define SDL_BUTTON_LEFT 1 +#define SDL_BUTTON_MIDDLE 2 +#define SDL_BUTTON_RIGHT 3 +#define SDL_BUTTON_WHEELUP 4 +#define SDL_BUTTON_WHEELDOWN 5 +#define SDL_BUTTON_X1 6 +#define SDL_BUTTON_X2 7 +#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) +#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) +#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) +#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1) +#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_mouse_h */ diff --git a/include/SDL_mutex.h b/include/SDL_mutex.h new file mode 100644 index 0000000..920971d --- /dev/null +++ b/include/SDL_mutex.h @@ -0,0 +1,177 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_mutex_h +#define _SDL_mutex_h + +/** @file SDL_mutex.h + * Functions to provide thread synchronization primitives + * + * @note These are independent of the other SDL routines. + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** Synchronization functions which can time out return this value + * if they time out. + */ +#define SDL_MUTEX_TIMEDOUT 1 + +/** This is the timeout value which corresponds to never time out */ +#define SDL_MUTEX_MAXWAIT (~(Uint32)0) + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name Mutex functions */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** The SDL mutex structure, defined in SDL_mutex.c */ +struct SDL_mutex; +typedef struct SDL_mutex SDL_mutex; + +/** Create a mutex, initialized unlocked */ +extern DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void); + +#define SDL_LockMutex(m) SDL_mutexP(m) +/** Lock the mutex + * @return 0, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex); + +#define SDL_UnlockMutex(m) SDL_mutexV(m) +/** Unlock the mutex + * @return 0, or -1 on error + * + * It is an error to unlock a mutex that has not been locked by + * the current thread, and doing so results in undefined behavior. + */ +extern DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex *mutex); + +/** Destroy a mutex */ +extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex); + +/*@}*/ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name Semaphore functions */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** The SDL semaphore structure, defined in SDL_sem.c */ +struct SDL_semaphore; +typedef struct SDL_semaphore SDL_sem; + +/** Create a semaphore, initialized with value, returns NULL on failure. */ +extern DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value); + +/** Destroy a semaphore */ +extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem); + +/** + * This function suspends the calling thread until the semaphore pointed + * to by sem has a positive count. It then atomically decreases the semaphore + * count. + */ +extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem); + +/** Non-blocking variant of SDL_SemWait(). + * @return 0 if the wait succeeds, + * SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem *sem); + +/** Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if + * the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in + * the allotted time, and -1 on error. + * + * On some platforms this function is implemented by looping with a delay + * of 1 ms, and so should be avoided if possible. + */ +extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms); + +/** Atomically increases the semaphore's count (not blocking). + * @return 0, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem *sem); + +/** Returns the current count of the semaphore */ +extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem *sem); + +/*@}*/ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name Condition_variable_functions */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*@{*/ +/** The SDL condition variable structure, defined in SDL_cond.c */ +struct SDL_cond; +typedef struct SDL_cond SDL_cond; +/*@}*/ + +/** Create a condition variable */ +extern DECLSPEC SDL_cond * SDLCALL SDL_CreateCond(void); + +/** Destroy a condition variable */ +extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond *cond); + +/** Restart one of the threads that are waiting on the condition variable, + * @return 0 or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond *cond); + +/** Restart all threads that are waiting on the condition variable, + * @return 0 or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond *cond); + +/** Wait on the condition variable, unlocking the provided mutex. + * The mutex must be locked before entering this function! + * The mutex is re-locked once the condition variable is signaled. + * @return 0 when it is signaled, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond *cond, SDL_mutex *mut); + +/** Waits for at most 'ms' milliseconds, and returns 0 if the condition + * variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not + * signaled in the allotted time, and -1 on error. + * On some platforms this function is implemented by looping with a delay + * of 1 ms, and so should be avoided if possible. + */ +extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms); + +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_mutex_h */ + diff --git a/include/SDL_name.h b/include/SDL_name.h new file mode 100644 index 0000000..511619a --- /dev/null +++ b/include/SDL_name.h @@ -0,0 +1,11 @@ + +#ifndef _SDLname_h_ +#define _SDLname_h_ + +#if defined(__STDC__) || defined(__cplusplus) +#define NeedFunctionPrototypes 1 +#endif + +#define SDL_NAME(X) SDL_##X + +#endif /* _SDLname_h_ */ diff --git a/include/SDL_opengl.h b/include/SDL_opengl.h new file mode 100644 index 0000000..c479a3a --- /dev/null +++ b/include/SDL_opengl.h @@ -0,0 +1,6556 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_opengl.h + * This is a simple file to encapsulate the OpenGL API headers + */ + +#include "SDL_config.h" + +#ifdef __WIN32__ +#define WIN32_LEAN_AND_MEAN +#ifndef NOMINMAX +#define NOMINMAX /* Don't defined min() and max() */ +#endif +#include +#endif +#ifndef NO_SDL_GLEXT +#define __glext_h_ /* Don't let gl.h include glext.h */ +#endif +#if defined(__MACOSX__) +#include /* Header File For The OpenGL Library */ +#include /* Header File For The GLU Library */ +#elif defined(__MACOS__) +#include /* Header File For The OpenGL Library */ +#include /* Header File For The GLU Library */ +#else +#include /* Header File For The OpenGL Library */ +#include /* Header File For The GLU Library */ +#endif +#ifndef NO_SDL_GLEXT +#undef __glext_h_ +#endif + +/** @name GLext.h + * This file taken from "GLext.h" from the Jeff Molofee OpenGL tutorials. + * It is included here because glext.h is not available on some systems. + * If you don't want this version included, simply define "NO_SDL_GLEXT" + */ +/*@{*/ +#ifndef NO_SDL_GLEXT +#if !defined(__glext_h_) && !defined(GL_GLEXT_LEGACY) +#define __glext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.1 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: This software was created using the +** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has +** not been independently verified as being compliant with the OpenGL(R) +** version 1.2.1 Specification. +*/ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#define WIN32_LEAN_AND_MEAN 1 +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif +#ifndef GLAPI +#define GLAPI extern +#endif + +/*************************************************************/ + +/* Header file version number, required by OpenGL ABI for Linux */ +/* glext.h last updated 2005/06/20 */ +/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ +#define GL_GLEXT_VERSION 29 + +#ifndef GL_VERSION_1_2 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_RESCALE_NORMAL 0x803A +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#endif + +#ifndef GL_ARB_imaging +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CONSTANT_BORDER 0x8151 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +#endif + +#ifndef GL_VERSION_1_3 +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_MULTISAMPLE_BIT 0x20000000 +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#endif + +#ifndef GL_VERSION_1_4 +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_COMPARE_R_TO_TEXTURE 0x884E +#endif + +#ifndef GL_VERSION_1_5 +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 +#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE +#define GL_FOG_COORD GL_FOG_COORDINATE +#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE +#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE +#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER +#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING +#define GL_SRC0_RGB GL_SOURCE0_RGB +#define GL_SRC1_RGB GL_SOURCE1_RGB +#define GL_SRC2_RGB GL_SOURCE2_RGB +#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA +#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA +#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA +#endif + +#ifndef GL_VERSION_2_0 +#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_COORDS 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 +#endif + +#ifndef GL_ARB_multitexture +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 +#endif + +#ifndef GL_ARB_multisample +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 +#endif + +#ifndef GL_ARB_texture_env_add +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C +#endif + +#ifndef GL_ARB_texture_compression +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_CLAMP_TO_BORDER_ARB 0x812D +#endif + +#ifndef GL_ARB_point_parameters +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 +#endif + +#ifndef GL_ARB_vertex_blend +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F +#endif + +#ifndef GL_ARB_matrix_palette +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#endif + +#ifndef GL_ARB_texture_env_crossbar +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF +#endif + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_ARB 0x8370 +#endif + +#ifndef GL_ARB_depth_texture +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B +#endif + +#ifndef GL_ARB_shadow +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E +#endif + +#ifndef GL_ARB_shadow_ambient +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF +#endif + +#ifndef GL_ARB_window_pos +#endif + +#ifndef GL_ARB_vertex_program +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF +#endif + +#ifndef GL_ARB_fragment_program +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 +#endif + +#ifndef GL_ARB_vertex_buffer_object +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA +#endif + +#ifndef GL_ARB_occlusion_query +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 +#endif + +#ifndef GL_ARB_shader_objects +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 +#endif + +#ifndef GL_ARB_vertex_shader +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A +#endif + +#ifndef GL_ARB_fragment_shader +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B +#endif + +#ifndef GL_ARB_shading_language_100 +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C +#endif + +#ifndef GL_ARB_texture_non_power_of_two +#endif + +#ifndef GL_ARB_point_sprite +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 +#endif + +#ifndef GL_ARB_fragment_program_shadow +#endif + +#ifndef GL_ARB_draw_buffers +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 +#endif + +#ifndef GL_ARB_texture_rectangle +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#endif + +#ifndef GL_ARB_color_buffer_float +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D +#endif + +#ifndef GL_ARB_half_float_pixel +#define GL_HALF_FLOAT_ARB 0x140B +#endif + +#ifndef GL_ARB_texture_float +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#endif + +#ifndef GL_ARB_pixel_buffer_object +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF +#endif + +#ifndef GL_EXT_abgr +#define GL_ABGR_EXT 0x8000 +#endif + +#ifndef GL_EXT_blend_color +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 +#endif + +#ifndef GL_EXT_texture +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 +#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 +#endif + +#ifndef GL_EXT_texture3D +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_FILTER4_SGIS 0x8146 +#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 +#endif + +#ifndef GL_EXT_subtexture +#endif + +#ifndef GL_EXT_copy_texture +#endif + +#ifndef GL_EXT_histogram +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 +#define GL_TABLE_TOO_LARGE_EXT 0x8031 +#endif + +#ifndef GL_EXT_convolution +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 +#endif + +#ifndef GL_SGI_color_matrix +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB +#endif + +#ifndef GL_SGI_color_table +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_PIXEL_TEXTURE_SGIS 0x8353 +#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 +#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 +#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_PIXEL_TEX_GEN_SGIX 0x8139 +#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B +#endif + +#ifndef GL_SGIS_texture4D +#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 +#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 +#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 +#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 +#define GL_TEXTURE_4D_SGIS 0x8134 +#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 +#define GL_TEXTURE_4DSIZE_SGIS 0x8136 +#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 +#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 +#define GL_TEXTURE_4D_BINDING_SGIS 0x814F +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD +#endif + +#ifndef GL_EXT_cmyka +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F +#endif + +#ifndef GL_EXT_texture_object +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 +#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 +#define GL_LINEAR_DETAIL_SGIS 0x8097 +#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 +#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 +#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A +#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B +#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_LINEAR_SHARPEN_SGIS 0x80AD +#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE +#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF +#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D +#endif + +#ifndef GL_SGIS_multisample +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_RESCALE_NORMAL_EXT 0x803A +#endif + +#ifndef GL_EXT_vertex_array +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 +#endif + +#ifndef GL_EXT_misc_attribute +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 +#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 +#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 +#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 +#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 +#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 +#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 +#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 +#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 +#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D +#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E +#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F +#endif + +#ifndef GL_SGIX_shadow +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_CLAMP_TO_EDGE_SGIS 0x812F +#endif + +#ifndef GL_SGIS_texture_border_clamp +#define GL_CLAMP_TO_BORDER_SGIS 0x812D +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B +#endif + +#ifndef GL_EXT_blend_logic_op +#endif + +#ifndef GL_SGIX_interlace +#define GL_INTERLACE_SGIX 0x8094 +#endif + +#ifndef GL_SGIX_pixel_tiles +#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E +#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F +#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 +#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 +#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 +#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 +#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 +#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 +#endif + +#ifndef GL_SGIS_texture_select +#define GL_DUAL_ALPHA4_SGIS 0x8110 +#define GL_DUAL_ALPHA8_SGIS 0x8111 +#define GL_DUAL_ALPHA12_SGIS 0x8112 +#define GL_DUAL_ALPHA16_SGIS 0x8113 +#define GL_DUAL_LUMINANCE4_SGIS 0x8114 +#define GL_DUAL_LUMINANCE8_SGIS 0x8115 +#define GL_DUAL_LUMINANCE12_SGIS 0x8116 +#define GL_DUAL_LUMINANCE16_SGIS 0x8117 +#define GL_DUAL_INTENSITY4_SGIS 0x8118 +#define GL_DUAL_INTENSITY8_SGIS 0x8119 +#define GL_DUAL_INTENSITY12_SGIS 0x811A +#define GL_DUAL_INTENSITY16_SGIS 0x811B +#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C +#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D +#define GL_QUAD_ALPHA4_SGIS 0x811E +#define GL_QUAD_ALPHA8_SGIS 0x811F +#define GL_QUAD_LUMINANCE4_SGIS 0x8120 +#define GL_QUAD_LUMINANCE8_SGIS 0x8121 +#define GL_QUAD_INTENSITY4_SGIS 0x8122 +#define GL_QUAD_INTENSITY8_SGIS 0x8123 +#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 +#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 +#endif + +#ifndef GL_SGIX_sprite +#define GL_SPRITE_SGIX 0x8148 +#define GL_SPRITE_MODE_SGIX 0x8149 +#define GL_SPRITE_AXIS_SGIX 0x814A +#define GL_SPRITE_TRANSLATION_SGIX 0x814B +#define GL_SPRITE_AXIAL_SGIX 0x814C +#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D +#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E +#endif + +#ifndef GL_EXT_point_parameters +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 +#endif + +#ifndef GL_SGIS_point_parameters +#define GL_POINT_SIZE_MIN_SGIS 0x8126 +#define GL_POINT_SIZE_MAX_SGIS 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 +#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 +#endif + +#ifndef GL_SGIX_instruments +#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 +#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 +#endif + +#ifndef GL_SGIX_texture_scale_bias +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C +#endif + +#ifndef GL_SGIX_framezoom +#define GL_FRAMEZOOM_SGIX 0x818B +#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C +#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#endif + +#ifndef GL_FfdMaskSGIX +#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 +#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 +#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 +#define GL_DEFORMATIONS_MASK_SGIX 0x8196 +#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_REFERENCE_PLANE_SGIX 0x817D +#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E +#endif + +#ifndef GL_SGIX_flush_raster +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 +#endif + +#ifndef GL_SGIS_fog_function +#define GL_FOG_FUNC_SGIS 0x812A +#define GL_FOG_FUNC_POINTS_SGIS 0x812B +#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 +#endif + +#ifndef GL_HP_image_transform +#define GL_IMAGE_SCALE_X_HP 0x8155 +#define GL_IMAGE_SCALE_Y_HP 0x8156 +#define GL_IMAGE_TRANSLATE_X_HP 0x8157 +#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 +#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 +#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A +#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B +#define GL_IMAGE_MAG_FILTER_HP 0x815C +#define GL_IMAGE_MIN_FILTER_HP 0x815D +#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E +#define GL_CUBIC_HP 0x815F +#define GL_AVERAGE_HP 0x8160 +#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 +#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 +#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_IGNORE_BORDER_HP 0x8150 +#define GL_CONSTANT_BORDER_HP 0x8151 +#define GL_REPLICATE_BORDER_HP 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 +#endif + +#ifndef GL_INGR_palette_buffer +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE +#endif + +#ifndef GL_EXT_color_subtable +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_VERTEX_DATA_HINT_PGI 0x1A22A +#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B +#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C +#define GL_MAX_VERTEX_HINT_PGI 0x1A22D +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 +#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD +#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 +#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C +#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E +#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F +#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 +#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 +#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 +#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 +#define GL_CLIP_NEAR_HINT_PGI 0x1A220 +#define GL_CLIP_FAR_HINT_PGI 0x1A221 +#define GL_WIDE_LINE_HINT_PGI 0x1A222 +#define GL_BACK_NORMALS_HINT_PGI 0x1A223 +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 +#endif + +#ifndef GL_SGIX_list_priority +#define GL_LIST_PRIORITY_SGIX 0x8182 +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_IR_INSTRUMENT1_SGIX 0x817F +#endif + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E +#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F +#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SHADOW_AMBIENT_SGIX 0x80BF +#endif + +#ifndef GL_EXT_index_texture +#endif + +#ifndef GL_EXT_index_material +#define GL_INDEX_MATERIAL_EXT 0x81B8 +#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 +#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA +#endif + +#ifndef GL_EXT_index_func +#define GL_INDEX_TEST_EXT 0x81B5 +#define GL_INDEX_TEST_FUNC_EXT 0x81B6 +#define GL_INDEX_TEST_REF_EXT 0x81B7 +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_IUI_V2F_EXT 0x81AD +#define GL_IUI_V3F_EXT 0x81AE +#define GL_IUI_N3F_V2F_EXT 0x81AF +#define GL_IUI_N3F_V3F_EXT 0x81B0 +#define GL_T2F_IUI_V2F_EXT 0x81B1 +#define GL_T2F_IUI_V3F_EXT 0x81B2 +#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 +#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_YCRCB_422_SGIX 0x81BB +#define GL_YCRCB_444_SGIX 0x81BC +#endif + +#ifndef GL_SGIX_fragment_lighting +#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 +#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 +#define GL_LIGHT_ENV_MODE_SGIX 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B +#define GL_FRAGMENT_LIGHT0_SGIX 0x840C +#define GL_FRAGMENT_LIGHT1_SGIX 0x840D +#define GL_FRAGMENT_LIGHT2_SGIX 0x840E +#define GL_FRAGMENT_LIGHT3_SGIX 0x840F +#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 +#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 +#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 +#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 +#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 +#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 +#endif + +#ifndef GL_WIN_phong_shading +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB +#endif + +#ifndef GL_WIN_specular_fog +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC +#endif + +#ifndef GL_EXT_light_texture +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 +/* reuse GL_FRAGMENT_DEPTH_EXT */ +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 +#endif + +#ifndef GL_SGIX_impact_pixel_texture +#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184 +#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185 +#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186 +#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187 +#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188 +#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189 +#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A +#endif + +#ifndef GL_EXT_bgra +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 +#endif + +#ifndef GL_SGIX_async +#define GL_ASYNC_MARKER_SGIX 0x8329 +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D +#endif + +#ifndef GL_INTEL_texture_scissor +#endif + +#ifndef GL_INTEL_parallel_arrays +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 +#endif + +#ifndef GL_HP_occlusion_test +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 +#endif + +#ifndef GL_EXT_pixel_transform +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA +#endif + +#ifndef GL_EXT_secondary_color +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF +#endif + +#ifndef GL_EXT_multi_draw_arrays +#endif + +#ifndef GL_EXT_fog_coord +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 +#endif + +#ifndef GL_EXT_coordinate_frame +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_TRANSFORM_HINT_APPLE 0x85B1 +#endif + +#ifndef GL_SGIX_fog_scale +#define GL_FOG_SCALE_SGIX 0x81FC +#define GL_FOG_SCALE_VALUE_SGIX 0x81FD +#endif + +#ifndef GL_SUNX_constant_data +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 +#endif + +#ifndef GL_SUN_global_alpha +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA +#endif + +#ifndef GL_SUN_triangle_list +#define GL_RESTART_SUN 0x0001 +#define GL_REPLACE_MIDDLE_SUN 0x0002 +#define GL_REPLACE_OLDEST_SUN 0x0003 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB +#endif + +#ifndef GL_SUN_vertex +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB +#endif + +#ifndef GL_INGR_color_clamp +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INTERLACE_READ_INGR 0x8568 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 +#endif + +#ifndef GL_EXT_422_pixels +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 +#endif + +#ifndef GL_EXT_texture_cube_map +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_WRAP_BORDER_SUN 0x81D4 +#endif + +#ifndef GL_EXT_texture_env_add +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW0_EXT GL_MODELVIEW +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 +#endif + +#ifndef GL_NV_register_combiners +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 +/* reuse GL_TEXTURE0_ARB */ +/* reuse GL_TEXTURE1_ARB */ +/* reuse GL_ZERO */ +/* reuse GL_NONE */ +/* reuse GL_FOG */ +#endif + +#ifndef GL_NV_fog_distance +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C +/* reuse GL_EYE_PLANE */ +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F +#endif + +#ifndef GL_NV_blend_square +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B +#endif + +#ifndef GL_MESA_resize_buffers +#endif + +#ifndef GL_MESA_window_pos +#endif + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_CULL_VERTEX_IBM 103050 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#endif + +#ifndef GL_IBM_vertex_array_lists +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 +#endif + +#ifndef GL_SGIX_subsample +#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 +#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 +#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 +#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 +#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 +#endif + +#ifndef GL_SGIX_ycrcb_subsample +#endif + +#ifndef GL_SGIX_ycrcba +#define GL_YCRCB_SGIX 0x8318 +#define GL_YCRCBA_SGIX 0x8319 +#endif + +#ifndef GL_SGI_depth_pass_instrument +#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 +#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 +#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 +#endif + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 +#endif + +#ifndef GL_3DFX_multisample +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 +#endif + +#ifndef GL_3DFX_tbuffer +#endif + +#ifndef GL_EXT_multisample +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 +#endif + +#ifndef GL_SGIX_vertex_preclip +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF +#endif + +#ifndef GL_SGIX_convolution_accuracy +#define GL_CONVOLUTION_HINT_SGIX 0x8316 +#endif + +#ifndef GL_SGIX_resample +#define GL_PACK_RESAMPLE_SGIX 0x842C +#define GL_UNPACK_RESAMPLE_SGIX 0x842D +#define GL_RESAMPLE_REPLICATE_SGIX 0x842E +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#endif + +#ifndef GL_SGIS_point_line_texgen +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 +#endif + +#ifndef GL_ATI_texture_mirror_once +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 +#endif + +#ifndef GL_NV_fence +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 +#endif + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_IBM 0x8370 +#endif + +#ifndef GL_NV_evaluators +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 +#endif + +#ifndef GL_NV_packed_depth_stencil +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA +#endif + +#ifndef GL_NV_register_combiners2 +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 +#endif + +#ifndef GL_NV_texture_compression_vtc +#endif + +#ifndef GL_NV_texture_rectangle +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 +#endif + +#ifndef GL_NV_texture_shader +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV +#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV +#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F +#endif + +#ifndef GL_NV_texture_shader2 +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#endif + +#ifndef GL_NV_vertex_array_range2 +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 +#endif + +#ifndef GL_NV_vertex_program +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F +#endif + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B +#endif + +#ifndef GL_SGIX_scalebias_hint +#define GL_SCALEBIAS_HINT_SGIX 0x8322 +#endif + +#ifndef GL_OML_interlace +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 +#endif + +#ifndef GL_OML_subsample +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 +#endif + +#ifndef GL_OML_resample +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 +#endif + +#ifndef GL_NV_copy_depth_to_color +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F +#endif + +#ifndef GL_ATI_envmap_bumpmap +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C +#endif + +#ifndef GL_ATI_fragment_shader +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_REG_6_ATI 0x8927 +#define GL_REG_7_ATI 0x8928 +#define GL_REG_8_ATI 0x8929 +#define GL_REG_9_ATI 0x892A +#define GL_REG_10_ATI 0x892B +#define GL_REG_11_ATI 0x892C +#define GL_REG_12_ATI 0x892D +#define GL_REG_13_ATI 0x892E +#define GL_REG_14_ATI 0x892F +#define GL_REG_15_ATI 0x8930 +#define GL_REG_16_ATI 0x8931 +#define GL_REG_17_ATI 0x8932 +#define GL_REG_18_ATI 0x8933 +#define GL_REG_19_ATI 0x8934 +#define GL_REG_20_ATI 0x8935 +#define GL_REG_21_ATI 0x8936 +#define GL_REG_22_ATI 0x8937 +#define GL_REG_23_ATI 0x8938 +#define GL_REG_24_ATI 0x8939 +#define GL_REG_25_ATI 0x893A +#define GL_REG_26_ATI 0x893B +#define GL_REG_27_ATI 0x893C +#define GL_REG_28_ATI 0x893D +#define GL_REG_29_ATI 0x893E +#define GL_REG_30_ATI 0x893F +#define GL_REG_31_ATI 0x8940 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_CON_8_ATI 0x8949 +#define GL_CON_9_ATI 0x894A +#define GL_CON_10_ATI 0x894B +#define GL_CON_11_ATI 0x894C +#define GL_CON_12_ATI 0x894D +#define GL_CON_13_ATI 0x894E +#define GL_CON_14_ATI 0x894F +#define GL_CON_15_ATI 0x8950 +#define GL_CON_16_ATI 0x8951 +#define GL_CON_17_ATI 0x8952 +#define GL_CON_18_ATI 0x8953 +#define GL_CON_19_ATI 0x8954 +#define GL_CON_20_ATI 0x8955 +#define GL_CON_21_ATI 0x8956 +#define GL_CON_22_ATI 0x8957 +#define GL_CON_23_ATI 0x8958 +#define GL_CON_24_ATI 0x8959 +#define GL_CON_25_ATI 0x895A +#define GL_CON_26_ATI 0x895B +#define GL_CON_27_ATI 0x895C +#define GL_CON_28_ATI 0x895D +#define GL_CON_29_ATI 0x895E +#define GL_CON_30_ATI 0x895F +#define GL_CON_31_ATI 0x8960 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B +#define GL_RED_BIT_ATI 0x00000001 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +#endif + +#ifndef GL_ATI_pn_triangles +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 +#endif + +#ifndef GL_ATI_vertex_array_object +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 +#endif + +#ifndef GL_EXT_vertex_shader +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED +#endif + +#ifndef GL_ATI_vertex_streams +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_STREAM0_ATI 0x876C +#define GL_VERTEX_STREAM1_ATI 0x876D +#define GL_VERTEX_STREAM2_ATI 0x876E +#define GL_VERTEX_STREAM3_ATI 0x876F +#define GL_VERTEX_STREAM4_ATI 0x8770 +#define GL_VERTEX_STREAM5_ATI 0x8771 +#define GL_VERTEX_STREAM6_ATI 0x8772 +#define GL_VERTEX_STREAM7_ATI 0x8773 +#define GL_VERTEX_SOURCE_ATI 0x8774 +#endif + +#ifndef GL_ATI_element_array +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A +#endif + +#ifndef GL_SUN_mesh_array +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 +#endif + +#ifndef GL_SUN_slice_accum +#define GL_SLICE_ACCUM_SUN 0x85CC +#endif + +#ifndef GL_NV_multisample_filter_hint +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 +#endif + +#ifndef GL_NV_depth_clamp +#define GL_DEPTH_CLAMP_NV 0x864F +#endif + +#ifndef GL_NV_occlusion_query +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 +#endif + +#ifndef GL_NV_point_sprite +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 +#endif + +#ifndef GL_NV_texture_shader3 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 +#endif + +#ifndef GL_NV_vertex_program1_1 +#endif + +#ifndef GL_EXT_shadow_funcs +#endif + +#ifndef GL_EXT_stencil_two_side +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 +#endif + +#ifndef GL_ATI_text_fragment_shader +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 +#endif + +#ifndef GL_APPLE_client_storage +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 +#endif + +#ifndef GL_APPLE_element_array +#define GL_ELEMENT_ARRAY_APPLE 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A +#endif + +#ifndef GL_APPLE_fence +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B +#endif + +#ifndef GL_APPLE_vertex_array_object +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 +#endif + +#ifndef GL_APPLE_vertex_array_range +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF +#endif + +#ifndef GL_APPLE_ycbcr_422 +#define GL_YCBCR_422_APPLE 0x85B9 +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#endif + +#ifndef GL_S3_s3tc +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#endif + +#ifndef GL_ATI_draw_buffers +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 +#endif + +#ifndef GL_ATI_pixel_format_float +#define GL_TYPE_RGBA_FLOAT_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 +#endif + +#ifndef GL_ATI_texture_env_combine3 +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 +#endif + +#ifndef GL_ATI_texture_float +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F +#endif + +#ifndef GL_NV_float_buffer +#define GL_FLOAT_R_NV 0x8880 +#define GL_FLOAT_RG_NV 0x8881 +#define GL_FLOAT_RGB_NV 0x8882 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E +#endif + +#ifndef GL_NV_fragment_program +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 +#endif + +#ifndef GL_NV_half_float +#define GL_HALF_FLOAT_NV 0x140B +#endif + +#ifndef GL_NV_pixel_data_range +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D +#endif + +#ifndef GL_NV_primitive_restart +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 +#endif + +#ifndef GL_NV_texture_expand_normal +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F +#endif + +#ifndef GL_NV_vertex_program2 +#endif + +#ifndef GL_ATI_map_object_buffer +#endif + +#ifndef GL_ATI_separate_stencil +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 +#endif + +#ifndef GL_ATI_vertex_attrib_array_object +#endif + +#ifndef GL_OES_read_format +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B +#endif + +#ifndef GL_EXT_depth_bounds_test +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 +#endif + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 +#endif + +#ifndef GL_EXT_blend_equation_separate +#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D +#endif + +#ifndef GL_MESA_pack_invert +#define GL_PACK_INVERT_MESA 0x8758 +#endif + +#ifndef GL_MESA_ycbcr_texture +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 +#endif + +#ifndef GL_EXT_pixel_buffer_object +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF +#endif + +#ifndef GL_NV_fragment_program_option +#endif + +#ifndef GL_NV_fragment_program2 +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 +#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 +#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 +#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 +#endif + +#ifndef GL_NV_vertex_program2_option +/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ +/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */ +#endif + +#ifndef GL_NV_vertex_program3 +/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ +#endif + +#ifndef GL_EXT_framebuffer_object +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 +#endif + +#ifndef GL_GREMEDY_string_marker +#endif + + +/*************************************************************/ + +#include +#ifndef GL_VERSION_2_0 +/* GL type for program/shader text */ +typedef char GLchar; /* native character */ +#endif + +#ifndef GL_VERSION_1_5 +/* GL types for handling large vertex buffer objects */ +typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; +#endif + +#ifndef GL_ARB_vertex_buffer_object +/* GL types for handling large vertex buffer objects */ +typedef ptrdiff_t GLintptrARB; +typedef ptrdiff_t GLsizeiptrARB; +#endif + +#ifndef GL_ARB_shader_objects +/* GL types for handling shader object handles and program/shader text */ +typedef char GLcharARB; /* native character */ +typedef unsigned int GLhandleARB; /* shader object handle */ +#endif + +/* GL types for "half" precision (s10e5) float data in host memory */ +#ifndef GL_ARB_half_float_pixel +typedef unsigned short GLhalfARB; +#endif + +#ifndef GL_NV_half_float +typedef unsigned short GLhalfNV; +#endif + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf); +GLAPI void APIENTRY glBlendEquation (GLenum); +GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei); +GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint); +GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); +GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean); +GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean); +GLAPI void APIENTRY glResetHistogram (GLenum); +GLAPI void APIENTRY glResetMinmax (GLenum); +GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTexture (GLenum); +GLAPI void APIENTRY glClientActiveTexture (GLenum); +GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble); +GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint); +GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort); +GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *); +GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *); +GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *); +GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *); +GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *); +GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean); +GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); +#endif + +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glFogCoordf (GLfloat); +GLAPI void APIENTRY glFogCoordfv (const GLfloat *); +GLAPI void APIENTRY glFogCoordd (GLdouble); +GLAPI void APIENTRY glFogCoorddv (const GLdouble *); +GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); +GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *); +GLAPI void APIENTRY glPointParameteri (GLenum, GLint); +GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *); +GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *); +GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *); +GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *); +GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint); +GLAPI void APIENTRY glSecondaryColor3iv (const GLint *); +GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *); +GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *); +GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *); +GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort); +GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *); +GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dv (const GLdouble *); +GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fv (const GLfloat *); +GLAPI void APIENTRY glWindowPos2i (GLint, GLint); +GLAPI void APIENTRY glWindowPos2iv (const GLint *); +GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2sv (const GLshort *); +GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dv (const GLdouble *); +GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fv (const GLfloat *); +GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3iv (const GLint *); +GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3sv (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); +#endif + +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsQuery (GLuint); +GLAPI void APIENTRY glBeginQuery (GLenum, GLuint); +GLAPI void APIENTRY glEndQuery (GLenum); +GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *); +GLAPI void APIENTRY glBindBuffer (GLenum, GLuint); +GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsBuffer (GLuint); +GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum); +GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *); +GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *); +GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum); +GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum); +GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params); +#endif + +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum); +GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *); +GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint); +GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint); +GLAPI void APIENTRY glAttachShader (GLuint, GLuint); +GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *); +GLAPI void APIENTRY glCompileShader (GLuint); +GLAPI GLuint APIENTRY glCreateProgram (void); +GLAPI GLuint APIENTRY glCreateShader (GLenum); +GLAPI void APIENTRY glDeleteProgram (GLuint); +GLAPI void APIENTRY glDeleteShader (GLuint); +GLAPI void APIENTRY glDetachShader (GLuint, GLuint); +GLAPI void APIENTRY glDisableVertexAttribArray (GLuint); +GLAPI void APIENTRY glEnableVertexAttribArray (GLuint); +GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); +GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); +GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *); +GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *); +GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *); +GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *); +GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *); +GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *); +GLAPI GLboolean APIENTRY glIsProgram (GLuint); +GLAPI GLboolean APIENTRY glIsShader (GLuint); +GLAPI void APIENTRY glLinkProgram (GLuint); +GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *); +GLAPI void APIENTRY glUseProgram (GLuint); +GLAPI void APIENTRY glUniform1f (GLint, GLfloat); +GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform1i (GLint, GLint); +GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint); +GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glValidateProgram (GLuint); +GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble); +GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); +typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); +typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); +typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length); +typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTextureARB (GLenum); +GLAPI void APIENTRY glClientActiveTextureARB (GLenum); +GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble); +GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint); +GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort); +GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *); +GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *); +GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *); +GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +#endif + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); +#endif + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 +#endif + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img); +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 +#endif + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *); +GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *); +GLAPI void APIENTRY glWeightivARB (GLint, const GLint *); +GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *); +GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *); +GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *); +GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *); +GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *); +GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexBlendARB (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); +typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); +typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); +typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); +typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); +typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); +typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); +#endif + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint); +GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *); +GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *); +GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *); +GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 +#endif + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 +#endif + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 +#endif + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 +#endif + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 +#endif + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 +#endif + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *); +GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *); +GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint); +GLAPI void APIENTRY glWindowPos2ivARB (const GLint *); +GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2svARB (const GLshort *); +GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *); +GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *); +GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3ivARB (const GLint *); +GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3svARB (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); +#endif + +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble); +GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); +GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint); +GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint); +GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint); +GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *); +GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *); +GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *); +GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *); +GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *); +GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *); +GLAPI GLboolean APIENTRY glIsProgramARB (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); +#endif + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 +/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */ +#endif + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint); +GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsBufferARB (GLuint); +GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum); +GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *); +GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *); +GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum); +GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum); +GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params); +#endif + +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsQueryARB (GLuint); +GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint); +GLAPI void APIENTRY glEndQueryARB (GLenum); +GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params); +#endif + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB); +GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum); +GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB); +GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum); +GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *); +GLAPI void APIENTRY glCompileShaderARB (GLhandleARB); +GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); +GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB); +GLAPI void APIENTRY glLinkProgramARB (GLhandleARB); +GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB); +GLAPI void APIENTRY glValidateProgramARB (GLhandleARB); +GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat); +GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform1iARB (GLint, GLint); +GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint); +GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *); +GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *); +GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); +GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *); +GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *); +GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); +GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *); +GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *); +GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length); +typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void); +typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); +typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); +#endif + +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *); +GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); +GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +#endif + +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 +#endif + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 +#endif + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 +#endif + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 +#endif + +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 +#endif + +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); +#endif + +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 +#endif + +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClampColorARB (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); +#endif + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 +#endif + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 +#endif + +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 +#endif + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 +#endif + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); +#endif + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 +#endif + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); +typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +#endif + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); +GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); +GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean); +GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean); +GLAPI void APIENTRY glResetHistogramEXT (GLenum); +GLAPI void APIENTRY glResetMinmaxEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); +#endif + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint); +GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); +GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +#endif + +#ifndef GL_EXT_color_matrix +#define GL_EXT_color_matrix 1 +#endif + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenSGIX (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint); +GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *); +GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat); +GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *); +GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *); +GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 +#endif + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 +#endif + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *); +GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint); +GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); +typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); +typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 +#endif + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean); +GLAPI void APIENTRY glSamplePatternSGIS (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 +#endif + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glArrayElementEXT (GLint); +GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei); +GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *); +GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *); +GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); +typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); +typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 +#endif + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 +#endif + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 +#endif + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 +#endif + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 +#endif + +#ifndef GL_SGIX_pixel_tiles +#define GL_SGIX_pixel_tiles 1 +#endif + +#ifndef GL_SGIX_texture_select +#define GL_SGIX_texture_select 1 +#endif + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat); +GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *); +GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint); +GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 +#endif + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_SGIS_point_parameters +#define GL_SGIS_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_SGIX_instruments +#define GL_SGIX_instruments 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); +GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *); +GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *); +GLAPI void APIENTRY glReadInstrumentsSGIX (GLint); +GLAPI void APIENTRY glStartInstrumentsSGIX (void); +GLAPI void APIENTRY glStopInstrumentsSGIX (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); +typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); +typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); +typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); +#endif + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 +#endif + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameZoomSGIX (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTagSampleBufferSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_SGIX_polynomial_ffd 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); +GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); +GLAPI void APIENTRY glDeformSGIX (GLbitfield); +GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); +#endif + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushRasterSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 +#endif + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 +#endif + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint); +GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 +#endif + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glHintPGI (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 +#endif + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat); +GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *); +GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint); +GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 +#endif + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_SGIX_calligraphic_fragment 1 +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 +#endif + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 +#endif + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei); +GLAPI void APIENTRY glUnlockArraysEXT (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *); +GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 +#endif + +#ifndef GL_SGIX_fragment_lighting +#define GL_SGIX_fragment_lighting 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum); +GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint); +GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat); +GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint); +GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *); +GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint); +GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +#endif + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 +#endif + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 +#endif + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glApplyTextureEXT (GLenum); +GLAPI void APIENTRY glTextureLightEXT (GLenum); +GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 +#endif + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 +#endif + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint); +GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *); +GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *); +GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei); +GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei); +GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); +typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); +typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 +#endif + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *); +GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *); +GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *); +GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +#endif + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 +#endif + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint); +GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 +#endif + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *); +GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *); +GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *); +GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *); +GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *); +GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *); +GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *); +GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort); +GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *); +GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureNormalEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +#endif + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogCoordfEXT (GLfloat); +GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *); +GLAPI void APIENTRY glFogCoorddEXT (GLdouble); +GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *); +GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 +#endif + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *); +GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *); +GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *); +GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glTangent3ivEXT (const GLint *); +GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glTangent3svEXT (const GLshort *); +GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *); +GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *); +GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *); +GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glBinormal3ivEXT (const GLint *); +GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glBinormal3svEXT (const GLshort *); +GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); +typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); +typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); +typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); +typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); +typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); +typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); +typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); +typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); +typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); +typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 +#endif + +#ifndef GL_SGIX_fog_scale +#define GL_SGIX_fog_scale 1 +#endif + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFinishTextureSUNX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); +#endif + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte); +GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort); +GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint); +GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat); +GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble); +GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte); +GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort); +GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +#endif + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint); +GLAPI void APIENTRY glReplacementCodeusSUN (GLushort); +GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte); +GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *); +GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *); +GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *); +GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer); +#endif + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif + +#ifndef GL_INGR_blend_func_separate +#define GL_INGR_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 +#endif + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 +#endif + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexWeightfEXT (GLfloat); +GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *); +GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); +GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer); +#endif + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *); +GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat); +GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *); +GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint); +GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean); +GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); +#endif + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 +#endif + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 +#endif + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glResizeBuffersMESA (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); +#endif + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint); +GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *); +GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *); +GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint); +GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride); +#endif + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint); +GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +#endif + +#ifndef GL_SGIX_subsample +#define GL_SGIX_subsample 1 +#endif + +#ifndef GL_SGIX_ycrcba +#define GL_SGIX_ycrcba 1 +#endif + +#ifndef GL_SGIX_ycrcb_subsample +#define GL_SGIX_ycrcb_subsample 1 +#endif + +#ifndef GL_SGIX_depth_pass_instrument +#define GL_SGIX_depth_pass_instrument 1 +#endif + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 +#endif + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 +#endif + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTbufferMask3DFX (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); +#endif + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean); +GLAPI void APIENTRY glSamplePatternEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); +#endif + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 +#endif + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 +#endif + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 +#endif + +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_SGIS_texture_color_mask 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +#endif + +#ifndef GL_SGIX_igloo_interface +#define GL_SGIX_igloo_interface 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 +#endif + +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 +#endif + +#ifndef GL_NV_fence +#define GL_NV_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsFenceNV (GLuint); +GLAPI GLboolean APIENTRY glTestFenceNV (GLuint); +GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glFinishFenceNV (GLuint); +GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); +typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +#endif + +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *); +GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *); +GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); +typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +#endif + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 +#endif + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 +#endif + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 +#endif + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 +#endif + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 +#endif + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 +#endif + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *); +GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint); +GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *); +GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *); +GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *); +GLAPI GLboolean APIENTRY glIsProgramNV (GLuint); +GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *); +GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *); +GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum); +GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble); +GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); +typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); +typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v); +typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); +#endif + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 +#endif + +#ifndef GL_SGIX_scalebias_hint +#define GL_SGIX_scalebias_hint 1 +#endif + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 +#endif + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 +#endif + +#ifndef GL_OML_resample +#define GL_OML_resample 1 +#endif + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 +#endif + +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *); +GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *); +GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +#endif + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint); +GLAPI void APIENTRY glBindFragmentShaderATI (GLuint); +GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint); +GLAPI void APIENTRY glBeginFragmentShaderATI (void); +GLAPI void APIENTRY glEndFragmentShaderATI (void); +GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum); +GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum); +GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); +#endif + +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint); +GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +#endif + +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum); +GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint); +GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum); +GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glFreeObjectBufferATI (GLuint); +GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); +typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); +#endif + +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginVertexShaderEXT (void); +GLAPI void APIENTRY glEndVertexShaderEXT (void); +GLAPI void APIENTRY glBindVertexShaderEXT (GLuint); +GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint); +GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint); +GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint); +GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint); +GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *); +GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *); +GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *); +GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *); +GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *); +GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *); +GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *); +GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *); +GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *); +GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint); +GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint); +GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum); +GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindParameterEXT (GLenum); +GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum); +GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *); +GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); +typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); +typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); +typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); +typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); +typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); +typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); +typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); +typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); +typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); +typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); +typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data); +typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +#endif + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort); +GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint); +GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat); +GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble); +GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint); +GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *); +GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum); +GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint); +GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +#endif + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *); +GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei); +GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +#endif + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); +#endif + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 +#endif + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 +#endif + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 +#endif + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint); +GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint); +GLAPI void APIENTRY glEndOcclusionQueryNV (void); +GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); +#endif + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint); +GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 +#endif + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 +#endif + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 +#endif + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); +#endif + +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 +#endif + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 +#endif + +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *); +GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei); +GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei); +GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); +#endif + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *); +GLAPI void APIENTRY glSetFenceAPPLE (GLuint); +GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint); +GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint); +GLAPI void APIENTRY glFinishFenceAPPLE (GLuint); +GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint); +GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); +typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); +typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +#endif + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint); +GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); +#endif + +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *); +GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *); +GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +#endif + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 +#endif + +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 +#endif + +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); +#endif + +#ifndef GL_ATI_pixel_format_float +#define GL_ATI_pixel_format_float 1 +/* This is really a WGL extension, but defines some associated GL enums. + * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string. + */ +#endif + +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 +#endif + +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 +#endif + +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 +#endif + +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 +/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *); +GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *); +GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); +#endif + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *); +GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV); +GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glFogCoordhNV (GLhalfNV); +GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *); +GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV); +GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); +typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); +typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); +typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); +typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +#endif + +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *); +GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +#endif + +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPrimitiveRestartNV (void); +GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +#endif + +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 +#endif + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 +#endif + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint); +GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); +#endif + +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +#endif + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); +#endif + +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 +#endif + +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); +#endif + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 +#endif + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); +#endif + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 +#endif + +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 +#endif + +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 +#endif + +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 +#endif + +#ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 +#endif + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 +#endif + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 +#endif + +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint); +GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *); +GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei); +GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *); +GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint); +GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *); +GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum); +GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint); +GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGenerateMipmapEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers); +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +#endif + +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); +#endif + + +#ifdef __cplusplus +} +#endif + +#endif +#endif /* NO_SDL_GLEXT */ +/*@}*/ diff --git a/include/SDL_platform.h b/include/SDL_platform.h new file mode 100644 index 0000000..11d8673 --- /dev/null +++ b/include/SDL_platform.h @@ -0,0 +1,110 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_platform.h + * Try to get a standard set of platform defines + */ + +#ifndef _SDL_platform_h +#define _SDL_platform_h + +#if defined(_AIX) +#undef __AIX__ +#define __AIX__ 1 +#endif +#if defined(__BEOS__) +#undef __BEOS__ +#define __BEOS__ 1 +#endif +#if defined(__HAIKU__) +#undef __HAIKU__ +#define __HAIKU__ 1 +#endif +#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) +#undef __BSDI__ +#define __BSDI__ 1 +#endif +#if defined(_arch_dreamcast) +#undef __DREAMCAST__ +#define __DREAMCAST__ 1 +#endif +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) +#undef __FREEBSD__ +#define __FREEBSD__ 1 +#endif +#if defined(__HAIKU__) +#undef __HAIKU__ +#define __HAIKU__ 1 +#endif +#if defined(hpux) || defined(__hpux) || defined(__hpux__) +#undef __HPUX__ +#define __HPUX__ 1 +#endif +#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) +#undef __IRIX__ +#define __IRIX__ 1 +#endif +#if defined(linux) || defined(__linux) || defined(__linux__) +#undef __LINUX__ +#define __LINUX__ 1 +#endif +#if defined(__APPLE__) +#undef __MACOSX__ +#define __MACOSX__ 1 +#elif defined(macintosh) +#undef __MACOS__ +#define __MACOS__ 1 +#endif +#if defined(__NetBSD__) +#undef __NETBSD__ +#define __NETBSD__ 1 +#endif +#if defined(__OpenBSD__) +#undef __OPENBSD__ +#define __OPENBSD__ 1 +#endif +#if defined(__OS2__) +#undef __OS2__ +#define __OS2__ 1 +#endif +#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) +#undef __OSF__ +#define __OSF__ 1 +#endif +#if defined(__QNXNTO__) +#undef __QNXNTO__ +#define __QNXNTO__ 1 +#endif +#if defined(riscos) || defined(__riscos) || defined(__riscos__) +#undef __RISCOS__ +#define __RISCOS__ 1 +#endif +#if defined(__SVR4) +#undef __SOLARIS__ +#define __SOLARIS__ 1 +#endif +#if defined(WIN32) || defined(_WIN32) +#undef __WIN32__ +#define __WIN32__ 1 +#endif + +#endif /* _SDL_platform_h */ diff --git a/include/SDL_quit.h b/include/SDL_quit.h new file mode 100644 index 0000000..6d82e7e --- /dev/null +++ b/include/SDL_quit.h @@ -0,0 +1,55 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_quit.h + * Include file for SDL quit event handling + */ + +#ifndef _SDL_quit_h +#define _SDL_quit_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +/** @file SDL_quit.h + * An SDL_QUITEVENT is generated when the user tries to close the application + * window. If it is ignored or filtered out, the window will remain open. + * If it is not ignored or filtered, it is queued normally and the window + * is allowed to close. When the window is closed, screen updates will + * complete, but have no effect. + * + * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) + * and SIGTERM (system termination request), if handlers do not already + * exist, that generate SDL_QUITEVENT events as well. There is no way + * to determine the cause of an SDL_QUITEVENT, but setting a signal + * handler in your application will override the default generation of + * quit events for that signal. + */ + +/** @file SDL_quit.h + * There are no functions directly affecting the quit event + */ + +#define SDL_QuitRequested() \ + (SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK)) + +#endif /* _SDL_quit_h */ diff --git a/include/SDL_rwops.h b/include/SDL_rwops.h new file mode 100644 index 0000000..a450119 --- /dev/null +++ b/include/SDL_rwops.h @@ -0,0 +1,155 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_rwops.h + * This file provides a general interface for SDL to read and write + * data sources. It can easily be extended to files, memory, etc. + */ + +#ifndef _SDL_rwops_h +#define _SDL_rwops_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** This is the read/write operation structure -- very basic */ + +typedef struct SDL_RWops { + /** Seek to 'offset' relative to whence, one of stdio's whence values: + * SEEK_SET, SEEK_CUR, SEEK_END + * Returns the final offset in the data source. + */ + int (SDLCALL *seek)(struct SDL_RWops *context, int offset, int whence); + + /** Read up to 'maxnum' objects each of size 'size' from the data + * source to the area pointed at by 'ptr'. + * Returns the number of objects read, or -1 if the read failed. + */ + int (SDLCALL *read)(struct SDL_RWops *context, void *ptr, int size, int maxnum); + + /** Write exactly 'num' objects each of size 'objsize' from the area + * pointed at by 'ptr' to data source. + * Returns 'num', or -1 if the write failed. + */ + int (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, int size, int num); + + /** Close and free an allocated SDL_FSops structure */ + int (SDLCALL *close)(struct SDL_RWops *context); + + Uint32 type; + union { +#if defined(__WIN32__) && !defined(__SYMBIAN32__) + struct { + int append; + void *h; + struct { + void *data; + int size; + int left; + } buffer; + } win32io; +#endif +#ifdef HAVE_STDIO_H + struct { + int autoclose; + FILE *fp; + } stdio; +#endif + struct { + Uint8 *base; + Uint8 *here; + Uint8 *stop; + } mem; + struct { + void *data1; + } unknown; + } hidden; + +} SDL_RWops; + + +/** @name Functions to create SDL_RWops structures from various data sources */ +/*@{*/ + +extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFile(const char *file, const char *mode); + +#ifdef HAVE_STDIO_H +extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFP(FILE *fp, int autoclose); +#endif + +extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromMem(void *mem, int size); +extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromConstMem(const void *mem, int size); + +extern DECLSPEC SDL_RWops * SDLCALL SDL_AllocRW(void); +extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops *area); + +/*@}*/ + +/** @name Seek Reference Points */ +/*@{*/ +#define RW_SEEK_SET 0 /**< Seek from the beginning of data */ +#define RW_SEEK_CUR 1 /**< Seek relative to current read point */ +#define RW_SEEK_END 2 /**< Seek relative to the end of data */ +/*@}*/ + +/** @name Macros to easily read and write from an SDL_RWops structure */ +/*@{*/ +#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence) +#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR) +#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n) +#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n) +#define SDL_RWclose(ctx) (ctx)->close(ctx) +/*@}*/ + +/** @name Read an item of the specified endianness and return in native format */ +/*@{*/ +extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops *src); +extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops *src); +extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops *src); +extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops *src); +extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops *src); +extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops *src); +/*@}*/ + +/** @name Write an item of native format to the specified endianness */ +/*@{*/ +extern DECLSPEC int SDLCALL SDL_WriteLE16(SDL_RWops *dst, Uint16 value); +extern DECLSPEC int SDLCALL SDL_WriteBE16(SDL_RWops *dst, Uint16 value); +extern DECLSPEC int SDLCALL SDL_WriteLE32(SDL_RWops *dst, Uint32 value); +extern DECLSPEC int SDLCALL SDL_WriteBE32(SDL_RWops *dst, Uint32 value); +extern DECLSPEC int SDLCALL SDL_WriteLE64(SDL_RWops *dst, Uint64 value); +extern DECLSPEC int SDLCALL SDL_WriteBE64(SDL_RWops *dst, Uint64 value); +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_rwops_h */ diff --git a/include/SDL_stdinc.h b/include/SDL_stdinc.h new file mode 100644 index 0000000..e1f85fb --- /dev/null +++ b/include/SDL_stdinc.h @@ -0,0 +1,620 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_stdinc.h + * This is a general header that includes C language support + */ + +#ifndef _SDL_stdinc_h +#define _SDL_stdinc_h + +#include "SDL_config.h" + + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_STDIO_H +#include +#endif +#if defined(STDC_HEADERS) +# include +# include +# include +#else +# if defined(HAVE_STDLIB_H) +# include +# elif defined(HAVE_MALLOC_H) +# include +# endif +# if defined(HAVE_STDDEF_H) +# include +# endif +# if defined(HAVE_STDARG_H) +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#if defined(HAVE_INTTYPES_H) +# include +#elif defined(HAVE_STDINT_H) +# include +#endif +#ifdef HAVE_CTYPE_H +# include +#endif +#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) +# include +#endif + +/** The number of elements in an array */ +#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) +#define SDL_TABLESIZE(table) SDL_arraysize(table) + +/* Use proper C++ casts when compiled as C++ to be compatible with the option + -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above. */ +#ifdef __cplusplus +#define SDL_reinterpret_cast(type, expression) reinterpret_cast(expression) +#define SDL_static_cast(type, expression) static_cast(expression) +#else +#define SDL_reinterpret_cast(type, expression) ((type)(expression)) +#define SDL_static_cast(type, expression) ((type)(expression)) +#endif + +/** @name Basic data types */ +/*@{*/ +typedef enum { + SDL_FALSE = 0, + SDL_TRUE = 1 +} SDL_bool; + +typedef int8_t Sint8; +typedef uint8_t Uint8; +typedef int16_t Sint16; +typedef uint16_t Uint16; +typedef int32_t Sint32; +typedef uint32_t Uint32; + +#ifdef SDL_HAS_64BIT_TYPE +typedef int64_t Sint64; +#ifndef SYMBIAN32_GCCE +typedef uint64_t Uint64; +#endif +#else +/* This is really just a hack to prevent the compiler from complaining */ +typedef struct { + Uint32 hi; + Uint32 lo; +} Uint64, Sint64; +#endif + +/*@}*/ + +/** @name Make sure the types really have the right sizes */ +/*@{*/ +#define SDL_COMPILE_TIME_ASSERT(name, x) \ + typedef int SDL_dummy_ ## name[(x) * 2 - 1] + +SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); +SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); +SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); +SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2); +SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4); +SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4); +SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8); +SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8); +/*@}*/ + +/** @name Enum Size Check + * Check to make sure enums are the size of ints, for structure packing. + * For both Watcom C/C++ and Borland C/C++ the compiler option that makes + * enums having the size of an int must be enabled. + * This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11). + */ +/* Enable enums always int in CodeWarrior (for MPW use "-enum int") */ +#ifdef __MWERKS__ +#pragma enumsalwaysint on +#endif + +typedef enum { + DUMMY_ENUM_VALUE +} SDL_DUMMY_ENUM; + +#ifndef __NDS__ +SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int)); +#endif +/*@}*/ + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef HAVE_MALLOC +#define SDL_malloc malloc +#else +extern DECLSPEC void * SDLCALL SDL_malloc(size_t size); +#endif + +#ifdef HAVE_CALLOC +#define SDL_calloc calloc +#else +extern DECLSPEC void * SDLCALL SDL_calloc(size_t nmemb, size_t size); +#endif + +#ifdef HAVE_REALLOC +#define SDL_realloc realloc +#else +extern DECLSPEC void * SDLCALL SDL_realloc(void *mem, size_t size); +#endif + +#ifdef HAVE_FREE +#define SDL_free free +#else +extern DECLSPEC void SDLCALL SDL_free(void *mem); +#endif + +#if defined(HAVE_ALLOCA) && !defined(alloca) +# if defined(HAVE_ALLOCA_H) +# include +# elif defined(__GNUC__) +# define alloca __builtin_alloca +# elif defined(_MSC_VER) +# include +# define alloca _alloca +# elif defined(__WATCOMC__) +# include +# elif defined(__BORLANDC__) +# include +# elif defined(__DMC__) +# include +# elif defined(__AIX__) + #pragma alloca +# elif defined(__MRC__) + void *alloca (unsigned); +# else + char *alloca (); +# endif +#endif +#ifdef HAVE_ALLOCA +#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count)) +#define SDL_stack_free(data) +#else +#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count)) +#define SDL_stack_free(data) SDL_free(data) +#endif + +#ifdef HAVE_GETENV +#define SDL_getenv getenv +#else +extern DECLSPEC char * SDLCALL SDL_getenv(const char *name); +#endif + +#ifdef HAVE_PUTENV +#define SDL_putenv putenv +#else +extern DECLSPEC int SDLCALL SDL_putenv(const char *variable); +#endif + +#ifdef HAVE_QSORT +#define SDL_qsort qsort +#else +extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, + int (*compare)(const void *, const void *)); +#endif + +#ifdef HAVE_ABS +#define SDL_abs abs +#else +#define SDL_abs(X) ((X) < 0 ? -(X) : (X)) +#endif + +#define SDL_min(x, y) (((x) < (y)) ? (x) : (y)) +#define SDL_max(x, y) (((x) > (y)) ? (x) : (y)) + +#ifdef HAVE_CTYPE_H +#define SDL_isdigit(X) isdigit(X) +#define SDL_isspace(X) isspace(X) +#define SDL_toupper(X) toupper(X) +#define SDL_tolower(X) tolower(X) +#else +#define SDL_isdigit(X) (((X) >= '0') && ((X) <= '9')) +#define SDL_isspace(X) (((X) == ' ') || ((X) == '\t') || ((X) == '\r') || ((X) == '\n')) +#define SDL_toupper(X) (((X) >= 'a') && ((X) <= 'z') ? ('A'+((X)-'a')) : (X)) +#define SDL_tolower(X) (((X) >= 'A') && ((X) <= 'Z') ? ('a'+((X)-'A')) : (X)) +#endif + +#ifdef HAVE_MEMSET +#define SDL_memset memset +#else +extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len); +#endif + +#if defined(__GNUC__) && defined(i386) +#define SDL_memset4(dst, val, len) \ +do { \ + int u0, u1, u2; \ + __asm__ __volatile__ ( \ + "cld\n\t" \ + "rep ; stosl\n\t" \ + : "=&D" (u0), "=&a" (u1), "=&c" (u2) \ + : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, len)) \ + : "memory" ); \ +} while(0) +#endif +#ifndef SDL_memset4 +#define SDL_memset4(dst, val, len) \ +do { \ + unsigned _count = (len); \ + unsigned _n = (_count + 3) / 4; \ + Uint32 *_p = SDL_static_cast(Uint32 *, dst); \ + Uint32 _val = (val); \ + if (len == 0) break; \ + switch (_count % 4) { \ + case 0: do { *_p++ = _val; \ + case 3: *_p++ = _val; \ + case 2: *_p++ = _val; \ + case 1: *_p++ = _val; \ + } while ( --_n ); \ + } \ +} while(0) +#endif + +/* We can count on memcpy existing on Mac OS X and being well-tuned. */ +#if defined(__MACH__) && defined(__APPLE__) +#define SDL_memcpy(dst, src, len) memcpy(dst, src, len) +#elif defined(__GNUC__) && defined(i386) +#define SDL_memcpy(dst, src, len) \ +do { \ + int u0, u1, u2; \ + __asm__ __volatile__ ( \ + "cld\n\t" \ + "rep ; movsl\n\t" \ + "testb $2,%b4\n\t" \ + "je 1f\n\t" \ + "movsw\n" \ + "1:\ttestb $1,%b4\n\t" \ + "je 2f\n\t" \ + "movsb\n" \ + "2:" \ + : "=&c" (u0), "=&D" (u1), "=&S" (u2) \ + : "0" (SDL_static_cast(unsigned, len)/4), "q" (len), "1" (dst),"2" (src) \ + : "memory" ); \ +} while(0) +#endif +#ifndef SDL_memcpy +#ifdef HAVE_MEMCPY +#define SDL_memcpy memcpy +#elif defined(HAVE_BCOPY) +#define SDL_memcpy(d, s, n) bcopy((s), (d), (n)) +#else +extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len); +#endif +#endif + +/* We can count on memcpy existing on Mac OS X and being well-tuned. */ +#if defined(__MACH__) && defined(__APPLE__) +#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4) +#elif defined(__GNUC__) && defined(i386) +#define SDL_memcpy4(dst, src, len) \ +do { \ + int ecx, edi, esi; \ + __asm__ __volatile__ ( \ + "cld\n\t" \ + "rep ; movsl" \ + : "=&c" (ecx), "=&D" (edi), "=&S" (esi) \ + : "0" (SDL_static_cast(unsigned, len)), "1" (dst), "2" (src) \ + : "memory" ); \ +} while(0) +#endif +#ifndef SDL_memcpy4 +#define SDL_memcpy4(dst, src, len) SDL_memcpy(dst, src, (len) << 2) +#endif + +#if defined(__GNUC__) && defined(i386) +#define SDL_revcpy(dst, src, len) \ +do { \ + int u0, u1, u2; \ + char *dstp = SDL_static_cast(char *, dst); \ + char *srcp = SDL_static_cast(char *, src); \ + int n = (len); \ + if ( n >= 4 ) { \ + __asm__ __volatile__ ( \ + "std\n\t" \ + "rep ; movsl\n\t" \ + "cld\n\t" \ + : "=&c" (u0), "=&D" (u1), "=&S" (u2) \ + : "0" (n >> 2), \ + "1" (dstp+(n-4)), "2" (srcp+(n-4)) \ + : "memory" ); \ + } \ + switch (n & 3) { \ + case 3: dstp[2] = srcp[2]; \ + case 2: dstp[1] = srcp[1]; \ + case 1: dstp[0] = srcp[0]; \ + break; \ + default: \ + break; \ + } \ +} while(0) +#endif +#ifndef SDL_revcpy +extern DECLSPEC void * SDLCALL SDL_revcpy(void *dst, const void *src, size_t len); +#endif + +#ifdef HAVE_MEMMOVE +#define SDL_memmove memmove +#elif defined(HAVE_BCOPY) +#define SDL_memmove(d, s, n) bcopy((s), (d), (n)) +#else +#define SDL_memmove(dst, src, len) \ +do { \ + if ( dst < src ) { \ + SDL_memcpy(dst, src, len); \ + } else { \ + SDL_revcpy(dst, src, len); \ + } \ +} while(0) +#endif + +#ifdef HAVE_MEMCMP +#define SDL_memcmp memcmp +#else +extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len); +#endif + +#ifdef HAVE_STRLEN +#define SDL_strlen strlen +#else +extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string); +#endif + +#ifdef HAVE_STRLCPY +#define SDL_strlcpy strlcpy +#else +extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen); +#endif + +#ifdef HAVE_STRLCAT +#define SDL_strlcat strlcat +#else +extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, size_t maxlen); +#endif + +#ifdef HAVE_STRDUP +#define SDL_strdup strdup +#else +extern DECLSPEC char * SDLCALL SDL_strdup(const char *string); +#endif + +#ifdef HAVE__STRREV +#define SDL_strrev _strrev +#else +extern DECLSPEC char * SDLCALL SDL_strrev(char *string); +#endif + +#ifdef HAVE__STRUPR +#define SDL_strupr _strupr +#else +extern DECLSPEC char * SDLCALL SDL_strupr(char *string); +#endif + +#ifdef HAVE__STRLWR +#define SDL_strlwr _strlwr +#else +extern DECLSPEC char * SDLCALL SDL_strlwr(char *string); +#endif + +#ifdef HAVE_STRCHR +#define SDL_strchr strchr +#elif defined(HAVE_INDEX) +#define SDL_strchr index +#else +extern DECLSPEC char * SDLCALL SDL_strchr(const char *string, int c); +#endif + +#ifdef HAVE_STRRCHR +#define SDL_strrchr strrchr +#elif defined(HAVE_RINDEX) +#define SDL_strrchr rindex +#else +extern DECLSPEC char * SDLCALL SDL_strrchr(const char *string, int c); +#endif + +#ifdef HAVE_STRSTR +#define SDL_strstr strstr +#else +extern DECLSPEC char * SDLCALL SDL_strstr(const char *haystack, const char *needle); +#endif + +#ifdef HAVE_ITOA +#define SDL_itoa itoa +#else +#define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix) +#endif + +#ifdef HAVE__LTOA +#define SDL_ltoa _ltoa +#else +extern DECLSPEC char * SDLCALL SDL_ltoa(long value, char *string, int radix); +#endif + +#ifdef HAVE__UITOA +#define SDL_uitoa _uitoa +#else +#define SDL_uitoa(value, string, radix) SDL_ultoa((long)value, string, radix) +#endif + +#ifdef HAVE__ULTOA +#define SDL_ultoa _ultoa +#else +extern DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *string, int radix); +#endif + +#ifdef HAVE_STRTOL +#define SDL_strtol strtol +#else +extern DECLSPEC long SDLCALL SDL_strtol(const char *string, char **endp, int base); +#endif + +#ifdef HAVE_STRTOUL +#define SDL_strtoul strtoul +#else +extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *string, char **endp, int base); +#endif + +#ifdef SDL_HAS_64BIT_TYPE + +#ifdef HAVE__I64TOA +#define SDL_lltoa _i64toa +#else +extern DECLSPEC char* SDLCALL SDL_lltoa(Sint64 value, char *string, int radix); +#endif + +#ifdef HAVE__UI64TOA +#define SDL_ulltoa _ui64toa +#else +extern DECLSPEC char* SDLCALL SDL_ulltoa(Uint64 value, char *string, int radix); +#endif + +#ifdef HAVE_STRTOLL +#define SDL_strtoll strtoll +#else +extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *string, char **endp, int base); +#endif + +#ifdef HAVE_STRTOULL +#define SDL_strtoull strtoull +#else +extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp, int base); +#endif + +#endif /* SDL_HAS_64BIT_TYPE */ + +#ifdef HAVE_STRTOD +#define SDL_strtod strtod +#else +extern DECLSPEC double SDLCALL SDL_strtod(const char *string, char **endp); +#endif + +#ifdef HAVE_ATOI +#define SDL_atoi atoi +#else +#define SDL_atoi(X) SDL_strtol(X, NULL, 0) +#endif + +#ifdef HAVE_ATOF +#define SDL_atof atof +#else +#define SDL_atof(X) SDL_strtod(X, NULL) +#endif + +#ifdef HAVE_STRCMP +#define SDL_strcmp strcmp +#else +extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2); +#endif + +#ifdef HAVE_STRNCMP +#define SDL_strncmp strncmp +#else +extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen); +#endif + +#ifdef HAVE_STRCASECMP +#define SDL_strcasecmp strcasecmp +#elif defined(HAVE__STRICMP) +#define SDL_strcasecmp _stricmp +#else +extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2); +#endif + +#ifdef HAVE_STRNCASECMP +#define SDL_strncasecmp strncasecmp +#elif defined(HAVE__STRNICMP) +#define SDL_strncasecmp _strnicmp +#else +extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen); +#endif + +#ifdef HAVE_SSCANF +#define SDL_sscanf sscanf +#else +extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, ...); +#endif + +#ifdef HAVE_SNPRINTF +#define SDL_snprintf snprintf +#else +extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...); +#endif + +#ifdef HAVE_VSNPRINTF +#define SDL_vsnprintf vsnprintf +#else +extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap); +#endif + +/** @name SDL_ICONV Error Codes + * The SDL implementation of iconv() returns these error codes + */ +/*@{*/ +#define SDL_ICONV_ERROR (size_t)-1 +#define SDL_ICONV_E2BIG (size_t)-2 +#define SDL_ICONV_EILSEQ (size_t)-3 +#define SDL_ICONV_EINVAL (size_t)-4 +/*@}*/ + +#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) +#define SDL_iconv_t iconv_t +#define SDL_iconv_open iconv_open +#define SDL_iconv_close iconv_close +#else +typedef struct _SDL_iconv_t *SDL_iconv_t; +extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, const char *fromcode); +extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); +#endif +extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); +/** This function converts a string between encodings in one pass, returning a + * string that must be freed with SDL_free() or NULL on error. + */ +extern DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft); +#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1) + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_stdinc_h */ diff --git a/include/SDL_syswm.h b/include/SDL_syswm.h new file mode 100644 index 0000000..716dddc --- /dev/null +++ b/include/SDL_syswm.h @@ -0,0 +1,225 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_syswm.h + * Include file for SDL custom system window manager hooks + */ + +#ifndef _SDL_syswm_h +#define _SDL_syswm_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_version.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @file SDL_syswm.h + * Your application has access to a special type of event 'SDL_SYSWMEVENT', + * which contains window-manager specific information and arrives whenever + * an unhandled window event occurs. This event is ignored by default, but + * you can enable it with SDL_EventState() + */ +#ifdef SDL_PROTOTYPES_ONLY +struct SDL_SysWMinfo; +typedef struct SDL_SysWMinfo SDL_SysWMinfo; +#else + +/* This is the structure for custom window manager events */ +#if defined(SDL_VIDEO_DRIVER_X11) +#if defined(__APPLE__) && defined(__MACH__) +/* conflicts with Quickdraw.h */ +#define Cursor X11Cursor +#endif + +#include +#include + +#if defined(__APPLE__) && defined(__MACH__) +/* matches the re-define above */ +#undef Cursor +#endif + +/** These are the various supported subsystems under UNIX */ +typedef enum { + SDL_SYSWM_X11 +} SDL_SYSWM_TYPE; + +/** The UNIX custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + SDL_SYSWM_TYPE subsystem; + union { + XEvent xevent; + } event; +}; + +/** The UNIX custom window manager information structure. + * When this structure is returned, it holds information about which + * low level system it is using, and will be one of SDL_SYSWM_TYPE. + */ +typedef struct SDL_SysWMinfo { + SDL_version version; + SDL_SYSWM_TYPE subsystem; + union { + struct { + Display *display; /**< The X11 display */ + Window window; /**< The X11 display window */ + /** These locking functions should be called around + * any X11 functions using the display variable, + * but not the gfxdisplay variable. + * They lock the event thread, so should not be + * called around event functions or from event filters. + */ + /*@{*/ + void (*lock_func)(void); + void (*unlock_func)(void); + /*@}*/ + + /** @name Introduced in SDL 1.0.2 */ + /*@{*/ + Window fswindow; /**< The X11 fullscreen window */ + Window wmwindow; /**< The X11 managed input window */ + /*@}*/ + + /** @name Introduced in SDL 1.2.12 */ + /*@{*/ + Display *gfxdisplay; /**< The X11 display to which rendering is done */ + /*@}*/ + } x11; + } info; +} SDL_SysWMinfo; + +#elif defined(SDL_VIDEO_DRIVER_NANOX) +#include + +/** The generic custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + int data; +}; + +/** The windows custom window manager information structure */ +typedef struct SDL_SysWMinfo { + SDL_version version ; + GR_WINDOW_ID window ; /* The display window */ +} SDL_SysWMinfo; + +#elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI) +#define WIN32_LEAN_AND_MEAN +#include + +/** The windows custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + HWND hwnd; /**< The window for the message */ + UINT msg; /**< The type of message */ + WPARAM wParam; /**< WORD message parameter */ + LPARAM lParam; /**< LONG message parameter */ +}; + +/** The windows custom window manager information structure */ +typedef struct SDL_SysWMinfo { + SDL_version version; + HWND window; /**< The Win32 display window */ + HGLRC hglrc; /**< The OpenGL context, if any */ +} SDL_SysWMinfo; + +#elif defined(SDL_VIDEO_DRIVER_RISCOS) + +/** RISC OS custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + int eventCode; /**< The window for the message */ + int pollBlock[64]; +}; + +/** The RISC OS custom window manager information structure */ +typedef struct SDL_SysWMinfo { + SDL_version version; + int wimpVersion; /**< Wimp version running under */ + int taskHandle; /**< The RISC OS task handle */ + int window; /**< The RISC OS display window */ +} SDL_SysWMinfo; + +#elif defined(SDL_VIDEO_DRIVER_PHOTON) +#include +#include + +/** The QNX custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + int data; +}; + +/** The QNX custom window manager information structure */ +typedef struct SDL_SysWMinfo { + SDL_version version; + int data; +} SDL_SysWMinfo; + +#else + +/** The generic custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + int data; +}; + +/** The generic custom window manager information structure */ +typedef struct SDL_SysWMinfo { + SDL_version version; + int data; +} SDL_SysWMinfo; + +#endif /* video driver type */ + +#endif /* SDL_PROTOTYPES_ONLY */ + +/* Function prototypes */ +/** + * This function gives you custom hooks into the window manager information. + * It fills the structure pointed to by 'info' with custom information and + * returns 1 if the function is implemented. If it's not implemented, or + * the version member of the 'info' structure is invalid, it returns 0. + * + * You typically use this function like this: + * @code + * SDL_SysWMInfo info; + * SDL_VERSION(&info.version); + * if ( SDL_GetWMInfo(&info) ) { ... } + * @endcode + */ +extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_syswm_h */ diff --git a/include/SDL_thread.h b/include/SDL_thread.h new file mode 100644 index 0000000..1ca9a1b --- /dev/null +++ b/include/SDL_thread.h @@ -0,0 +1,120 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_thread_h +#define _SDL_thread_h + +/** @file SDL_thread.h + * Header for the SDL thread management routines + * + * @note These are independent of the other SDL routines. + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +/* Thread synchronization primitives */ +#include "SDL_mutex.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** The SDL thread structure, defined in SDL_thread.c */ +struct SDL_Thread; +typedef struct SDL_Thread SDL_Thread; + +/** Create a thread */ +#if ((defined(__WIN32__) && !defined(HAVE_LIBC)) || defined(__OS2__)) && !defined(__SYMBIAN32__) +/** + * We compile SDL into a DLL on OS/2. This means, that it's the DLL which + * creates a new thread for the calling process with the SDL_CreateThread() + * API. There is a problem with this, that only the RTL of the SDL.DLL will + * be initialized for those threads, and not the RTL of the calling application! + * To solve this, we make a little hack here. + * We'll always use the caller's _beginthread() and _endthread() APIs to + * start a new thread. This way, if it's the SDL.DLL which uses this API, + * then the RTL of SDL.DLL will be used to create the new thread, and if it's + * the application, then the RTL of the application will be used. + * So, in short: + * Always use the _beginthread() and _endthread() of the calling runtime library! + */ +#define SDL_PASSED_BEGINTHREAD_ENDTHREAD +#ifndef _WIN32_WCE +#include /* This has _beginthread() and _endthread() defined! */ +#endif + +#ifdef __OS2__ +typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg); +typedef void (*pfnSDL_CurrentEndThread)(void); +#elif __GNUC__ +typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, + unsigned (__stdcall *func)(void *), void *arg, + unsigned, unsigned *threadID); +typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); +#else +typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, + unsigned (__stdcall *func)(void *), void *arg, + unsigned, unsigned *threadID); +typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); +#endif + +extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread); + +#ifdef __OS2__ +#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthread, _endthread) +#elif defined(_WIN32_WCE) +#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, NULL, NULL) +#else +#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthreadex, _endthreadex) +#endif +#else +extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data); +#endif + +/** Get the 32-bit thread identifier for the current thread */ +extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void); + +/** Get the 32-bit thread identifier for the specified thread, + * equivalent to SDL_ThreadID() if the specified thread is NULL. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread *thread); + +/** Wait for a thread to finish. + * The return code for the thread function is placed in the area + * pointed to by 'status', if 'status' is not NULL. + */ +extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status); + +/** Forcefully kill a thread without worrying about its state */ +extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_thread_h */ diff --git a/include/SDL_timer.h b/include/SDL_timer.h new file mode 100644 index 0000000..d7cd024 --- /dev/null +++ b/include/SDL_timer.h @@ -0,0 +1,125 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_timer_h +#define _SDL_timer_h + +/** @file SDL_timer.h + * Header for the SDL time management routines + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** This is the OS scheduler timeslice, in milliseconds */ +#define SDL_TIMESLICE 10 + +/** This is the maximum resolution of the SDL timer on all platforms */ +#define TIMER_RESOLUTION 10 /**< Experimentally determined */ + +/** + * Get the number of milliseconds since the SDL library initialization. + * Note that this value wraps if the program runs for more than ~49 days. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); + +/** Wait a specified number of milliseconds before returning */ +extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); + +/** Function prototype for the timer callback function */ +typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval); + +/** + * Set a callback to run after the specified number of milliseconds has + * elapsed. The callback function is passed the current timer interval + * and returns the next timer interval. If the returned value is the + * same as the one passed in, the periodic alarm continues, otherwise a + * new alarm is scheduled. If the callback returns 0, the periodic alarm + * is cancelled. + * + * To cancel a currently running timer, call SDL_SetTimer(0, NULL); + * + * The timer callback function may run in a different thread than your + * main code, and so shouldn't call any functions from within itself. + * + * The maximum resolution of this timer is 10 ms, which means that if + * you request a 16 ms timer, your callback will run approximately 20 ms + * later on an unloaded system. If you wanted to set a flag signaling + * a frame update at 30 frames per second (every 33 ms), you might set a + * timer for 30 ms: + * @code SDL_SetTimer((33/10)*10, flag_update); @endcode + * + * If you use this function, you need to pass SDL_INIT_TIMER to SDL_Init(). + * + * Under UNIX, you should not use raise or use SIGALRM and this function + * in the same program, as it is implemented using setitimer(). You also + * should not use this function in multi-threaded applications as signals + * to multi-threaded apps have undefined behavior in some implementations. + * + * This function returns 0 if successful, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback); + +/** @name New timer API + * New timer API, supports multiple timers + * Written by Stephane Peter + */ +/*@{*/ + +/** + * Function prototype for the new timer callback function. + * The callback function is passed the current timer interval and returns + * the next timer interval. If the returned value is the same as the one + * passed in, the periodic alarm continues, otherwise a new alarm is + * scheduled. If the callback returns 0, the periodic alarm is cancelled. + */ +typedef Uint32 (SDLCALL *SDL_NewTimerCallback)(Uint32 interval, void *param); + +/** Definition of the timer ID type */ +typedef struct _SDL_TimerID *SDL_TimerID; + +/** Add a new timer to the pool of timers already running. + * Returns a timer ID, or NULL when an error occurs. + */ +extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param); + +/** + * Remove one of the multiple timers knowing its ID. + * Returns a boolean value indicating success. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t); + +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_timer_h */ diff --git a/include/SDL_types.h b/include/SDL_types.h new file mode 100644 index 0000000..cfa3523 --- /dev/null +++ b/include/SDL_types.h @@ -0,0 +1,28 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_types.h + * @deprecated Use SDL_stdinc.h instead. + */ + +/* DEPRECATED */ +#include "SDL_stdinc.h" diff --git a/include/SDL_version.h b/include/SDL_version.h new file mode 100644 index 0000000..fa02c3f --- /dev/null +++ b/include/SDL_version.h @@ -0,0 +1,91 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_version.h + * This header defines the current SDL version + */ + +#ifndef _SDL_version_h +#define _SDL_version_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @name Version Number + * Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL + */ +/*@{*/ +#define SDL_MAJOR_VERSION 1 +#define SDL_MINOR_VERSION 2 +#define SDL_PATCHLEVEL 14 +/*@}*/ + +typedef struct SDL_version { + Uint8 major; + Uint8 minor; + Uint8 patch; +} SDL_version; + +/** + * This macro can be used to fill a version structure with the compile-time + * version of the SDL library. + */ +#define SDL_VERSION(X) \ +{ \ + (X)->major = SDL_MAJOR_VERSION; \ + (X)->minor = SDL_MINOR_VERSION; \ + (X)->patch = SDL_PATCHLEVEL; \ +} + +/** This macro turns the version numbers into a numeric value: + * (1,2,3) -> (1203) + * This assumes that there will never be more than 100 patchlevels + */ +#define SDL_VERSIONNUM(X, Y, Z) \ + ((X)*1000 + (Y)*100 + (Z)) + +/** This is the version number macro for the current SDL version */ +#define SDL_COMPILEDVERSION \ + SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) + +/** This macro will evaluate to true if compiled with SDL at least X.Y.Z */ +#define SDL_VERSION_ATLEAST(X, Y, Z) \ + (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) + +/** This function gets the version of the dynamically linked SDL library. + * it should NOT be used to fill a version structure, instead you should + * use the SDL_Version() macro. + */ +extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_version_h */ diff --git a/include/SDL_video.h b/include/SDL_video.h new file mode 100644 index 0000000..8f7f305 --- /dev/null +++ b/include/SDL_video.h @@ -0,0 +1,951 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_video.h + * Header file for access to the SDL raw framebuffer window + */ + +#ifndef _SDL_video_h +#define _SDL_video_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_rwops.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @name Transparency definitions + * These define alpha as the opacity of a surface + */ +/*@{*/ +#define SDL_ALPHA_OPAQUE 255 +#define SDL_ALPHA_TRANSPARENT 0 +/*@}*/ + +/** @name Useful data types */ +/*@{*/ +typedef struct SDL_Rect { + Sint16 x, y; + Uint16 w, h; +} SDL_Rect; + +typedef struct SDL_Color { + Uint8 r; + Uint8 g; + Uint8 b; + Uint8 unused; +} SDL_Color; +#define SDL_Colour SDL_Color + +typedef struct SDL_Palette { + int ncolors; + SDL_Color *colors; +} SDL_Palette; +/*@}*/ + +/** Everything in the pixel format structure is read-only */ +typedef struct SDL_PixelFormat { + SDL_Palette *palette; + Uint8 BitsPerPixel; + Uint8 BytesPerPixel; + Uint8 Rloss; + Uint8 Gloss; + Uint8 Bloss; + Uint8 Aloss; + Uint8 Rshift; + Uint8 Gshift; + Uint8 Bshift; + Uint8 Ashift; + Uint32 Rmask; + Uint32 Gmask; + Uint32 Bmask; + Uint32 Amask; + + /** RGB color key information */ + Uint32 colorkey; + /** Alpha value information (per-surface alpha) */ + Uint8 alpha; +} SDL_PixelFormat; + +/** This structure should be treated as read-only, except for 'pixels', + * which, if not NULL, contains the raw pixel data for the surface. + */ +typedef struct SDL_Surface { + Uint32 flags; /**< Read-only */ + SDL_PixelFormat *format; /**< Read-only */ + int w, h; /**< Read-only */ + Uint16 pitch; /**< Read-only */ + void *pixels; /**< Read-write */ + int offset; /**< Private */ + + /** Hardware-specific surface info */ + struct private_hwdata *hwdata; + + /** clipping information */ + SDL_Rect clip_rect; /**< Read-only */ + Uint32 unused1; /**< for binary compatibility */ + + /** Allow recursive locks */ + Uint32 locked; /**< Private */ + + /** info for fast blit mapping to other surfaces */ + struct SDL_BlitMap *map; /**< Private */ + + /** format version, bumped at every change to invalidate blit maps */ + unsigned int format_version; /**< Private */ + + /** Reference count -- used when freeing surface */ + int refcount; /**< Read-mostly */ +} SDL_Surface; + +/** @name SDL_Surface Flags + * These are the currently supported flags for the SDL_surface + */ +/*@{*/ + +/** Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */ +/*@{*/ +#define SDL_SWSURFACE 0x00000000 /**< Surface is in system memory */ +#define SDL_HWSURFACE 0x00000001 /**< Surface is in video memory */ +#define SDL_ASYNCBLIT 0x00000004 /**< Use asynchronous blits if possible */ +/*@}*/ + +/** Available for SDL_SetVideoMode() */ +/*@{*/ +#define SDL_ANYFORMAT 0x10000000 /**< Allow any video depth/pixel-format */ +#define SDL_HWPALETTE 0x20000000 /**< Surface has exclusive palette */ +#define SDL_DOUBLEBUF 0x40000000 /**< Set up double-buffered video mode */ +#define SDL_FULLSCREEN 0x80000000 /**< Surface is a full screen display */ +#define SDL_OPENGL 0x00000002 /**< Create an OpenGL rendering context */ +#define SDL_OPENGLBLIT 0x0000000A /**< Create an OpenGL rendering context and use it for blitting */ +#define SDL_RESIZABLE 0x00000010 /**< This video mode may be resized */ +#define SDL_NOFRAME 0x00000020 /**< No window caption or edge frame */ +/*@}*/ + +/** Used internally (read-only) */ +/*@{*/ +#define SDL_HWACCEL 0x00000100 /**< Blit uses hardware acceleration */ +#define SDL_SRCCOLORKEY 0x00001000 /**< Blit uses a source color key */ +#define SDL_RLEACCELOK 0x00002000 /**< Private flag */ +#define SDL_RLEACCEL 0x00004000 /**< Surface is RLE encoded */ +#define SDL_SRCALPHA 0x00010000 /**< Blit uses source alpha blending */ +#define SDL_PREALLOC 0x01000000 /**< Surface uses preallocated memory */ +/*@}*/ + +/*@}*/ + +/** Evaluates to true if the surface needs to be locked before access */ +#define SDL_MUSTLOCK(surface) \ + (surface->offset || \ + ((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0)) + +/** typedef for private surface blitting functions */ +typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect, + struct SDL_Surface *dst, SDL_Rect *dstrect); + + +/** Useful for determining the video hardware capabilities */ +typedef struct SDL_VideoInfo { + Uint32 hw_available :1; /**< Flag: Can you create hardware surfaces? */ + Uint32 wm_available :1; /**< Flag: Can you talk to a window manager? */ + Uint32 UnusedBits1 :6; + Uint32 UnusedBits2 :1; + Uint32 blit_hw :1; /**< Flag: Accelerated blits HW --> HW */ + Uint32 blit_hw_CC :1; /**< Flag: Accelerated blits with Colorkey */ + Uint32 blit_hw_A :1; /**< Flag: Accelerated blits with Alpha */ + Uint32 blit_sw :1; /**< Flag: Accelerated blits SW --> HW */ + Uint32 blit_sw_CC :1; /**< Flag: Accelerated blits with Colorkey */ + Uint32 blit_sw_A :1; /**< Flag: Accelerated blits with Alpha */ + Uint32 blit_fill :1; /**< Flag: Accelerated color fill */ + Uint32 UnusedBits3 :16; + Uint32 video_mem; /**< The total amount of video memory (in K) */ + SDL_PixelFormat *vfmt; /**< Value: The format of the video surface */ + int current_w; /**< Value: The current video mode width */ + int current_h; /**< Value: The current video mode height */ +} SDL_VideoInfo; + + +/** @name Overlay Formats + * The most common video overlay formats. + * For an explanation of these pixel formats, see: + * http://www.webartz.com/fourcc/indexyuv.htm + * + * For information on the relationship between color spaces, see: + * http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html + */ +/*@{*/ +#define SDL_YV12_OVERLAY 0x32315659 /**< Planar mode: Y + V + U (3 planes) */ +#define SDL_IYUV_OVERLAY 0x56555949 /**< Planar mode: Y + U + V (3 planes) */ +#define SDL_YUY2_OVERLAY 0x32595559 /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ +#define SDL_UYVY_OVERLAY 0x59565955 /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ +#define SDL_YVYU_OVERLAY 0x55595659 /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ +/*@}*/ + +/** The YUV hardware video overlay */ +typedef struct SDL_Overlay { + Uint32 format; /**< Read-only */ + int w, h; /**< Read-only */ + int planes; /**< Read-only */ + Uint16 *pitches; /**< Read-only */ + Uint8 **pixels; /**< Read-write */ + + /** @name Hardware-specific surface info */ + /*@{*/ + struct private_yuvhwfuncs *hwfuncs; + struct private_yuvhwdata *hwdata; + /*@{*/ + + /** @name Special flags */ + /*@{*/ + Uint32 hw_overlay :1; /**< Flag: This overlay hardware accelerated? */ + Uint32 UnusedBits :31; + /*@}*/ +} SDL_Overlay; + + +/** Public enumeration for setting the OpenGL window attributes. */ +typedef enum { + SDL_GL_RED_SIZE, + SDL_GL_GREEN_SIZE, + SDL_GL_BLUE_SIZE, + SDL_GL_ALPHA_SIZE, + SDL_GL_BUFFER_SIZE, + SDL_GL_DOUBLEBUFFER, + SDL_GL_DEPTH_SIZE, + SDL_GL_STENCIL_SIZE, + SDL_GL_ACCUM_RED_SIZE, + SDL_GL_ACCUM_GREEN_SIZE, + SDL_GL_ACCUM_BLUE_SIZE, + SDL_GL_ACCUM_ALPHA_SIZE, + SDL_GL_STEREO, + SDL_GL_MULTISAMPLEBUFFERS, + SDL_GL_MULTISAMPLESAMPLES, + SDL_GL_ACCELERATED_VISUAL, + SDL_GL_SWAP_CONTROL +} SDL_GLattr; + +/** @name flags for SDL_SetPalette() */ +/*@{*/ +#define SDL_LOGPAL 0x01 +#define SDL_PHYSPAL 0x02 +/*@}*/ + +/* Function prototypes */ + +/** + * @name Video Init and Quit + * These functions are used internally, and should not be used unless you + * have a specific need to specify the video driver you want to use. + * You should normally use SDL_Init() or SDL_InitSubSystem(). + */ +/*@{*/ +/** + * Initializes the video subsystem. Sets up a connection + * to the window manager, etc, and determines the current video mode and + * pixel format, but does not initialize a window or graphics mode. + * Note that event handling is activated by this routine. + * + * If you use both sound and video in your application, you need to call + * SDL_Init() before opening the sound device, otherwise under Win32 DirectX, + * you won't be able to set full-screen display modes. + */ +extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name, Uint32 flags); +extern DECLSPEC void SDLCALL SDL_VideoQuit(void); +/*@}*/ + +/** + * This function fills the given character buffer with the name of the + * video driver, and returns a pointer to it if the video driver has + * been initialized. It returns NULL if no driver has been initialized. + */ +extern DECLSPEC char * SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen); + +/** + * This function returns a pointer to the current display surface. + * If SDL is doing format conversion on the display surface, this + * function returns the publicly visible surface, not the real video + * surface. + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_GetVideoSurface(void); + +/** + * This function returns a read-only pointer to information about the + * video hardware. If this is called before SDL_SetVideoMode(), the 'vfmt' + * member of the returned structure will contain the pixel format of the + * "best" video mode. + */ +extern DECLSPEC const SDL_VideoInfo * SDLCALL SDL_GetVideoInfo(void); + +/** + * Check to see if a particular video mode is supported. + * It returns 0 if the requested mode is not supported under any bit depth, + * or returns the bits-per-pixel of the closest available mode with the + * given width and height. If this bits-per-pixel is different from the + * one used when setting the video mode, SDL_SetVideoMode() will succeed, + * but will emulate the requested bits-per-pixel with a shadow surface. + * + * The arguments to SDL_VideoModeOK() are the same ones you would pass to + * SDL_SetVideoMode() + */ +extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags); + +/** + * Return a pointer to an array of available screen dimensions for the + * given format and video flags, sorted largest to smallest. Returns + * NULL if there are no dimensions available for a particular format, + * or (SDL_Rect **)-1 if any dimension is okay for the given format. + * + * If 'format' is NULL, the mode list will be for the format given + * by SDL_GetVideoInfo()->vfmt + */ +extern DECLSPEC SDL_Rect ** SDLCALL SDL_ListModes(SDL_PixelFormat *format, Uint32 flags); + +/** + * Set up a video mode with the specified width, height and bits-per-pixel. + * + * If 'bpp' is 0, it is treated as the current display bits per pixel. + * + * If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the + * requested bits-per-pixel, but will return whatever video pixel format is + * available. The default is to emulate the requested pixel format if it + * is not natively available. + * + * If SDL_HWSURFACE is set in 'flags', the video surface will be placed in + * video memory, if possible, and you may have to call SDL_LockSurface() + * in order to access the raw framebuffer. Otherwise, the video surface + * will be created in system memory. + * + * If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle + * updates asynchronously, but you must always lock before accessing pixels. + * SDL will wait for updates to complete before returning from the lock. + * + * If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee + * that the colors set by SDL_SetColors() will be the colors you get. + * Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all + * of the colors exactly the way they are requested, and you should look + * at the video surface structure to determine the actual palette. + * If SDL cannot guarantee that the colors you request can be set, + * i.e. if the colormap is shared, then the video surface may be created + * under emulation in system memory, overriding the SDL_HWSURFACE flag. + * + * If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set + * a fullscreen video mode. The default is to create a windowed mode + * if the current graphics system has a window manager. + * If the SDL library is able to set a fullscreen video mode, this flag + * will be set in the surface that is returned. + * + * If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up + * two surfaces in video memory and swap between them when you call + * SDL_Flip(). This is usually slower than the normal single-buffering + * scheme, but prevents "tearing" artifacts caused by modifying video + * memory while the monitor is refreshing. It should only be used by + * applications that redraw the entire screen on every update. + * + * If SDL_RESIZABLE is set in 'flags', the SDL library will allow the + * window manager, if any, to resize the window at runtime. When this + * occurs, SDL will send a SDL_VIDEORESIZE event to you application, + * and you must respond to the event by re-calling SDL_SetVideoMode() + * with the requested size (or another size that suits the application). + * + * If SDL_NOFRAME is set in 'flags', the SDL library will create a window + * without any title bar or frame decoration. Fullscreen video modes have + * this flag set automatically. + * + * This function returns the video framebuffer surface, or NULL if it fails. + * + * If you rely on functionality provided by certain video flags, check the + * flags of the returned surface to make sure that functionality is available. + * SDL will fall back to reduced functionality if the exact flags you wanted + * are not available. + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_SetVideoMode + (int width, int height, int bpp, Uint32 flags); + +/** @name SDL_Update Functions + * These functions should not be called while 'screen' is locked. + */ +/*@{*/ +/** + * Makes sure the given list of rectangles is updated on the given screen. + */ +extern DECLSPEC void SDLCALL SDL_UpdateRects + (SDL_Surface *screen, int numrects, SDL_Rect *rects); +/** + * If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire + * screen. + */ +extern DECLSPEC void SDLCALL SDL_UpdateRect + (SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h); +/*@}*/ + +/** + * On hardware that supports double-buffering, this function sets up a flip + * and returns. The hardware will wait for vertical retrace, and then swap + * video buffers before the next video surface blit or lock will return. + * On hardware that doesn not support double-buffering, this is equivalent + * to calling SDL_UpdateRect(screen, 0, 0, 0, 0); + * The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when + * setting the video mode for this function to perform hardware flipping. + * This function returns 0 if successful, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface *screen); + +/** + * Set the gamma correction for each of the color channels. + * The gamma values range (approximately) between 0.1 and 10.0 + * + * If this function isn't supported directly by the hardware, it will + * be emulated using gamma ramps, if available. If successful, this + * function returns 0, otherwise it returns -1. + */ +extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue); + +/** + * Set the gamma translation table for the red, green, and blue channels + * of the video hardware. Each table is an array of 256 16-bit quantities, + * representing a mapping between the input and output for that channel. + * The input is the index into the array, and the output is the 16-bit + * gamma value at that index, scaled to the output color precision. + * + * You may pass NULL for any of the channels to leave it unchanged. + * If the call succeeds, it will return 0. If the display driver or + * hardware does not support gamma translation, or otherwise fails, + * this function will return -1. + */ +extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue); + +/** + * Retrieve the current values of the gamma translation tables. + * + * You must pass in valid pointers to arrays of 256 16-bit quantities. + * Any of the pointers may be NULL to ignore that channel. + * If the call succeeds, it will return 0. If the display driver or + * hardware does not support gamma translation, or otherwise fails, + * this function will return -1. + */ +extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue); + +/** + * Sets a portion of the colormap for the given 8-bit surface. If 'surface' + * is not a palettized surface, this function does nothing, returning 0. + * If all of the colors were set as passed to SDL_SetColors(), it will + * return 1. If not all the color entries were set exactly as given, + * it will return 0, and you should look at the surface palette to + * determine the actual color palette. + * + * When 'surface' is the surface associated with the current display, the + * display colormap will be updated with the requested colors. If + * SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors() + * will always return 1, and the palette is guaranteed to be set the way + * you desire, even if the window colormap has to be warped or run under + * emulation. + */ +extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface *surface, + SDL_Color *colors, int firstcolor, int ncolors); + +/** + * Sets a portion of the colormap for a given 8-bit surface. + * 'flags' is one or both of: + * SDL_LOGPAL -- set logical palette, which controls how blits are mapped + * to/from the surface, + * SDL_PHYSPAL -- set physical palette, which controls how pixels look on + * the screen + * Only screens have physical palettes. Separate change of physical/logical + * palettes is only possible if the screen has SDL_HWPALETTE set. + * + * The return value is 1 if all colours could be set as requested, and 0 + * otherwise. + * + * SDL_SetColors() is equivalent to calling this function with + * flags = (SDL_LOGPAL|SDL_PHYSPAL). + */ +extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface *surface, int flags, + SDL_Color *colors, int firstcolor, + int ncolors); + +/** + * Maps an RGB triple to an opaque pixel value for a given pixel format + */ +extern DECLSPEC Uint32 SDLCALL SDL_MapRGB +(const SDL_PixelFormat * const format, + const Uint8 r, const Uint8 g, const Uint8 b); + +/** + * Maps an RGBA quadruple to a pixel value for a given pixel format + */ +extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA +(const SDL_PixelFormat * const format, + const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a); + +/** + * Maps a pixel value into the RGB components for a given pixel format + */ +extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, + const SDL_PixelFormat * const fmt, + Uint8 *r, Uint8 *g, Uint8 *b); + +/** + * Maps a pixel value into the RGBA components for a given pixel format + */ +extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, + const SDL_PixelFormat * const fmt, + Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); + +/** @sa SDL_CreateRGBSurface */ +#define SDL_AllocSurface SDL_CreateRGBSurface +/** + * Allocate and free an RGB surface (must be called after SDL_SetVideoMode) + * If the depth is 4 or 8 bits, an empty palette is allocated for the surface. + * If the depth is greater than 8 bits, the pixel format is set using the + * flags '[RGB]mask'. + * If the function runs out of memory, it will return NULL. + * + * The 'flags' tell what kind of surface to create. + * SDL_SWSURFACE means that the surface should be created in system memory. + * SDL_HWSURFACE means that the surface should be created in video memory, + * with the same format as the display surface. This is useful for surfaces + * that will not change much, to take advantage of hardware acceleration + * when being blitted to the display surface. + * SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with + * this surface, but you must always lock it before accessing the pixels. + * SDL will wait for current blits to finish before returning from the lock. + * SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits. + * If the hardware supports acceleration of colorkey blits between + * two surfaces in video memory, SDL will try to place the surface in + * video memory. If this isn't possible or if there is no hardware + * acceleration available, the surface will be placed in system memory. + * SDL_SRCALPHA means that the surface will be used for alpha blits and + * if the hardware supports hardware acceleration of alpha blits between + * two surfaces in video memory, to place the surface in video memory + * if possible, otherwise it will be placed in system memory. + * If the surface is created in video memory, blits will be _much_ faster, + * but the surface format must be identical to the video surface format, + * and the only way to access the pixels member of the surface is to use + * the SDL_LockSurface() and SDL_UnlockSurface() calls. + * If the requested surface actually resides in video memory, SDL_HWSURFACE + * will be set in the flags member of the returned surface. If for some + * reason the surface could not be placed in video memory, it will not have + * the SDL_HWSURFACE flag set, and will be created in system memory instead. + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurface + (Uint32 flags, int width, int height, int depth, + Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); +/** @sa SDL_CreateRGBSurface */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels, + int width, int height, int depth, int pitch, + Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); +extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface); + +/** + * SDL_LockSurface() sets up a surface for directly accessing the pixels. + * Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write + * to and read from 'surface->pixels', using the pixel format stored in + * 'surface->format'. Once you are done accessing the surface, you should + * use SDL_UnlockSurface() to release it. + * + * Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates + * to 0, then you can read and write to the surface at any time, and the + * pixel format of the surface will not change. In particular, if the + * SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you + * will not need to lock the display surface before accessing it. + * + * No operating system or library calls should be made between lock/unlock + * pairs, as critical system locks may be held during this time. + * + * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked. + */ +extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface); +extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface); + +/** + * Load a surface from a seekable SDL data source (memory or file.) + * If 'freesrc' is non-zero, the source will be closed after being read. + * Returns the new surface, or NULL if there was an error. + * The new surface should be freed with SDL_FreeSurface(). + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, int freesrc); + +/** Convenience macro -- load a surface from a file */ +#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1) + +/** + * Save a surface to a seekable SDL data source (memory or file.) + * If 'freedst' is non-zero, the source will be closed after being written. + * Returns 0 if successful or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_SaveBMP_RW + (SDL_Surface *surface, SDL_RWops *dst, int freedst); + +/** Convenience macro -- save a surface to a file */ +#define SDL_SaveBMP(surface, file) \ + SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1) + +/** + * Sets the color key (transparent pixel) in a blittable surface. + * If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL), + * 'key' will be the transparent pixel in the source image of a blit. + * SDL_RLEACCEL requests RLE acceleration for the surface if present, + * and removes RLE acceleration if absent. + * If 'flag' is 0, this function clears any current color key. + * This function returns 0, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_SetColorKey + (SDL_Surface *surface, Uint32 flag, Uint32 key); + +/** + * This function sets the alpha value for the entire surface, as opposed to + * using the alpha component of each pixel. This value measures the range + * of transparency of the surface, 0 being completely transparent to 255 + * being completely opaque. An 'alpha' value of 255 causes blits to be + * opaque, the source pixels copied to the destination (the default). Note + * that per-surface alpha can be combined with colorkey transparency. + * + * If 'flag' is 0, alpha blending is disabled for the surface. + * If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface. + * OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the + * surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed. + * + * The 'alpha' parameter is ignored for surfaces that have an alpha channel. + */ +extern DECLSPEC int SDLCALL SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha); + +/** + * Sets the clipping rectangle for the destination surface in a blit. + * + * If the clip rectangle is NULL, clipping will be disabled. + * If the clip rectangle doesn't intersect the surface, the function will + * return SDL_FALSE and blits will be completely clipped. Otherwise the + * function returns SDL_TRUE and blits to the surface will be clipped to + * the intersection of the surface area and the clipping rectangle. + * + * Note that blits are automatically clipped to the edges of the source + * and destination surfaces. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect); + +/** + * Gets the clipping rectangle for the destination surface in a blit. + * 'rect' must be a pointer to a valid rectangle which will be filled + * with the correct values. + */ +extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect); + +/** + * Creates a new surface of the specified format, and then copies and maps + * the given surface to it so the blit of the converted surface will be as + * fast as possible. If this function fails, it returns NULL. + * + * The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those + * semantics. You can also pass SDL_RLEACCEL in the flags parameter and + * SDL will try to RLE accelerate colorkey and alpha blits in the resulting + * surface. + * + * This function is used internally by SDL_DisplayFormat(). + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface + (SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags); + +/** + * This performs a fast blit from the source surface to the destination + * surface. It assumes that the source and destination rectangles are + * the same size. If either 'srcrect' or 'dstrect' are NULL, the entire + * surface (src or dst) is copied. The final blit rectangles are saved + * in 'srcrect' and 'dstrect' after all clipping is performed. + * If the blit is successful, it returns 0, otherwise it returns -1. + * + * The blit function should not be called on a locked surface. + * + * The blit semantics for surfaces with and without alpha and colorkey + * are defined as follows: + * + * RGBA->RGB: + * SDL_SRCALPHA set: + * alpha-blend (using alpha-channel). + * SDL_SRCCOLORKEY ignored. + * SDL_SRCALPHA not set: + * copy RGB. + * if SDL_SRCCOLORKEY set, only copy the pixels matching the + * RGB values of the source colour key, ignoring alpha in the + * comparison. + * + * RGB->RGBA: + * SDL_SRCALPHA set: + * alpha-blend (using the source per-surface alpha value); + * set destination alpha to opaque. + * SDL_SRCALPHA not set: + * copy RGB, set destination alpha to source per-surface alpha value. + * both: + * if SDL_SRCCOLORKEY set, only copy the pixels matching the + * source colour key. + * + * RGBA->RGBA: + * SDL_SRCALPHA set: + * alpha-blend (using the source alpha channel) the RGB values; + * leave destination alpha untouched. [Note: is this correct?] + * SDL_SRCCOLORKEY ignored. + * SDL_SRCALPHA not set: + * copy all of RGBA to the destination. + * if SDL_SRCCOLORKEY set, only copy the pixels matching the + * RGB values of the source colour key, ignoring alpha in the + * comparison. + * + * RGB->RGB: + * SDL_SRCALPHA set: + * alpha-blend (using the source per-surface alpha value). + * SDL_SRCALPHA not set: + * copy RGB. + * both: + * if SDL_SRCCOLORKEY set, only copy the pixels matching the + * source colour key. + * + * If either of the surfaces were in video memory, and the blit returns -2, + * the video memory was lost, so it should be reloaded with artwork and + * re-blitted: + * @code + * while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) { + * while ( SDL_LockSurface(image) < 0 ) + * Sleep(10); + * -- Write image pixels to image->pixels -- + * SDL_UnlockSurface(image); + * } + * @endcode + * + * This happens under DirectX 5.0 when the system switches away from your + * fullscreen application. The lock will also fail until you have access + * to the video memory again. + * + * You should call SDL_BlitSurface() unless you know exactly how SDL + * blitting works internally and how to use the other blit functions. + */ +#define SDL_BlitSurface SDL_UpperBlit + +/** This is the public blit function, SDL_BlitSurface(), and it performs + * rectangle validation and clipping before passing it to SDL_LowerBlit() + */ +extern DECLSPEC int SDLCALL SDL_UpperBlit + (SDL_Surface *src, SDL_Rect *srcrect, + SDL_Surface *dst, SDL_Rect *dstrect); +/** This is a semi-private blit function and it performs low-level surface + * blitting only. + */ +extern DECLSPEC int SDLCALL SDL_LowerBlit + (SDL_Surface *src, SDL_Rect *srcrect, + SDL_Surface *dst, SDL_Rect *dstrect); + +/** + * This function performs a fast fill of the given rectangle with 'color' + * The given rectangle is clipped to the destination surface clip area + * and the final fill rectangle is saved in the passed in pointer. + * If 'dstrect' is NULL, the whole surface will be filled with 'color' + * The color should be a pixel of the format used by the surface, and + * can be generated by the SDL_MapRGB() function. + * This function returns 0 on success, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_FillRect + (SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color); + +/** + * This function takes a surface and copies it to a new surface of the + * pixel format and colors of the video framebuffer, suitable for fast + * blitting onto the display surface. It calls SDL_ConvertSurface() + * + * If you want to take advantage of hardware colorkey or alpha blit + * acceleration, you should set the colorkey and alpha value before + * calling this function. + * + * If the conversion fails or runs out of memory, it returns NULL + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormat(SDL_Surface *surface); + +/** + * This function takes a surface and copies it to a new surface of the + * pixel format and colors of the video framebuffer (if possible), + * suitable for fast alpha blitting onto the display surface. + * The new surface will always have an alpha channel. + * + * If you want to take advantage of hardware colorkey or alpha blit + * acceleration, you should set the colorkey and alpha value before + * calling this function. + * + * If the conversion fails or runs out of memory, it returns NULL + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *surface); + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name YUV video surface overlay functions */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** This function creates a video output overlay + * Calling the returned surface an overlay is something of a misnomer because + * the contents of the display surface underneath the area where the overlay + * is shown is undefined - it may be overwritten with the converted YUV data. + */ +extern DECLSPEC SDL_Overlay * SDLCALL SDL_CreateYUVOverlay(int width, int height, + Uint32 format, SDL_Surface *display); + +/** Lock an overlay for direct access, and unlock it when you are done */ +extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay *overlay); +extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay *overlay); + +/** Blit a video overlay to the display surface. + * The contents of the video surface underneath the blit destination are + * not defined. + * The width and height of the destination rectangle may be different from + * that of the overlay, but currently only 2x scaling is supported. + */ +extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect); + +/** Free a video overlay */ +extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay *overlay); + +/*@}*/ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name OpenGL support functions. */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** + * Dynamically load an OpenGL library, or the default one if path is NULL + * + * If you do this, you need to retrieve all of the GL functions used in + * your program from the dynamic library using SDL_GL_GetProcAddress(). + */ +extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); + +/** + * Get the address of a GL function + */ +extern DECLSPEC void * SDLCALL SDL_GL_GetProcAddress(const char* proc); + +/** + * Set an attribute of the OpenGL subsystem before intialization. + */ +extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); + +/** + * Get an attribute of the OpenGL subsystem from the windowing + * interface, such as glX. This is of course different from getting + * the values from SDL's internal OpenGL subsystem, which only + * stores the values you request before initialization. + * + * Developers should track the values they pass into SDL_GL_SetAttribute + * themselves if they want to retrieve these values. + */ +extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int* value); + +/** + * Swap the OpenGL buffers, if double-buffering is supported. + */ +extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void); + +/** @name OpenGL Internal Functions + * Internal functions that should not be called unless you have read + * and understood the source code for these functions. + */ +/*@{*/ +extern DECLSPEC void SDLCALL SDL_GL_UpdateRects(int numrects, SDL_Rect* rects); +extern DECLSPEC void SDLCALL SDL_GL_Lock(void); +extern DECLSPEC void SDLCALL SDL_GL_Unlock(void); +/*@}*/ + +/*@}*/ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name Window Manager Functions */ +/** These functions allow interaction with the window manager, if any. */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** + * Sets the title and icon text of the display window (UTF-8 encoded) + */ +extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title, const char *icon); +/** + * Gets the title and icon text of the display window (UTF-8 encoded) + */ +extern DECLSPEC void SDLCALL SDL_WM_GetCaption(char **title, char **icon); + +/** + * Sets the icon for the display window. + * This function must be called before the first call to SDL_SetVideoMode(). + * It takes an icon surface, and a mask in MSB format. + * If 'mask' is NULL, the entire icon surface will be used as the icon. + */ +extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask); + +/** + * This function iconifies the window, and returns 1 if it succeeded. + * If the function succeeds, it generates an SDL_APPACTIVE loss event. + * This function is a noop and returns 0 in non-windowed environments. + */ +extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void); + +/** + * Toggle fullscreen mode without changing the contents of the screen. + * If the display surface does not require locking before accessing + * the pixel information, then the memory pointers will not change. + * + * If this function was able to toggle fullscreen mode (change from + * running in a window to fullscreen, or vice-versa), it will return 1. + * If it is not implemented, or fails, it returns 0. + * + * The next call to SDL_SetVideoMode() will set the mode fullscreen + * attribute based on the flags parameter - if SDL_FULLSCREEN is not + * set, then the display will be windowed by default where supported. + * + * This is currently only implemented in the X11 video driver. + */ +extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface *surface); + +typedef enum { + SDL_GRAB_QUERY = -1, + SDL_GRAB_OFF = 0, + SDL_GRAB_ON = 1, + SDL_GRAB_FULLSCREEN /**< Used internally */ +} SDL_GrabMode; +/** + * This function allows you to set and query the input grab state of + * the application. It returns the new input grab state. + * + * Grabbing means that the mouse is confined to the application window, + * and nearly all keyboard input is passed directly to the application, + * and not interpreted by a window manager, if any. + */ +extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode); + +/*@}*/ + +/** @internal Not in public API at the moment - do not use! */ +extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect, + SDL_Surface *dst, SDL_Rect *dstrect); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_video_h */ diff --git a/include/begin_code.h b/include/begin_code.h new file mode 100644 index 0000000..2274809 --- /dev/null +++ b/include/begin_code.h @@ -0,0 +1,191 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + 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 + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file begin_code.h + * This file sets things up for C dynamic library function definitions, + * static inlined functions, and structures aligned at 4-byte alignment. + * If you don't like ugly C preprocessor code, don't look at this file. :) + */ + +/** + * @file begin_code.h + * This shouldn't be nested -- included it around code only. + */ +#ifdef _begin_code_h +#error Nested inclusion of begin_code.h +#endif +#define _begin_code_h + +/** + * @def DECLSPEC + * Some compilers use a special export keyword + */ +#ifndef DECLSPEC +# if defined(__BEOS__) || defined(__HAIKU__) +# if defined(__GNUC__) +# define DECLSPEC __declspec(dllexport) +# else +# define DECLSPEC __declspec(export) +# endif +# elif defined(__WIN32__) +# ifdef __BORLANDC__ +# ifdef BUILD_SDL +# define DECLSPEC +# else +# define DECLSPEC __declspec(dllimport) +# endif +# else +# define DECLSPEC __declspec(dllexport) +# endif +# elif defined(__OS2__) +# ifdef __WATCOMC__ +# ifdef BUILD_SDL +# define DECLSPEC __declspec(dllexport) +# else +# define DECLSPEC +# endif +# elif defined (__GNUC__) && __GNUC__ < 4 +# /* Added support for GCC-EMX = 4 +# define DECLSPEC __attribute__ ((visibility("default"))) +# else +# define DECLSPEC +# endif +# endif +#endif + +/** + * @def SDLCALL + * By default SDL uses the C calling convention + */ +#ifndef SDLCALL +# if defined(__WIN32__) && !defined(__GNUC__) +# define SDLCALL __cdecl +# elif defined(__OS2__) +# if defined (__GNUC__) && __GNUC__ < 4 +# /* Added support for GCC-EMX